I want to start a new activity called Counter
when a button is clicked, but I got an error that is the activity is not found...so where is the wrong in my code:
t = new Thread(){
public void run(){
try{
sleep(5000);
}
catch (InterruptedException e){
e.printStackTrace();
}
finally{
Intent counter = new Intent("com.example.test.Counter");
startActivity(counter);
}
}
};
test.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
t.run();
}
});
this is the manifest file :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.test.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.test.Counter"
android:label="@string/title_activity_counter" >
</activity>
</application>
</manifest>