Я использую учебное пособие для Android «Привет, Тестирование» с использованием Eclipse Galileo. (http://developer.android.com/resources/tutorials/testing/helloandroid_test.html) Когда я пытаюсь скомпилировать и запустить программу, я получаю сообщение об ошибке «com.example.helloandroid.R.id не может быть разрешен».Ошибка программирования Android
package com.example.helloandroid.test;
import com.example.helloandroid.HelloAndroid;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.TextView;
public class HelloAndroidTest extends ActivityInstrumentationTestCase2<HelloAndroid>
{
private HelloAndroid mActivity; // the activity under test
private TextView mView; // the activity's TextView (the only view)
private String resourceString;
public HelloAndroidTest()
{
super("com.example.helloandroid", HelloAndroid.class);
}
@Override
protected void setUp() throws Exception
{
super.setUp();
mActivity = this.getActivity();
mView = (TextView) mActivity.findViewById(com.example.helloandroid.R.id.textview);
resourceString = mActivity.getString(com.example.helloandroid.R.string.hello);
}
public void testPreconditions()
{
assertNotNull(mView);
}
public void testText()
{
assertEquals(resourceString,(String)mView.getText());
}
}
Спасибо за любую помощь/советую предложить!
Пожалуйста, пост весь код. Вероятно, вам не хватает импорта. – birryree 2010-11-22 21:01:26