Eclipse Galileoを使用してAndroidの「Hello、Testing」チュートリアルを行っています。 (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