所以,我的应用程序很简单,在主屏幕中我应该单击一个按钮,该按钮将启动另一个带有选项卡的活动,但是一旦我单击该按钮,该活动就不会启动,并且我收到错误:此日志未找到源:
Thread [<3> main] (Suspended (exception RuntimeException))
<VM does not provide monitor information>
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2503
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2519
ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 123
ActivityThread$H.handleMessage(Message) line: 1870
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4370
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]
这是 mainActivity:Bienvenue.java:
public class Bienvenue extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bienvenue);
Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new View.OnClickListener(){
public void onClick(View arg0) {
// here i call new screen;
Intent i = new Intent(Bienvenue.this, Histoire.class);
startActivity(i);
}
});
}
这是清单的一部分:
<activity android:name=".Splash" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.category.MAIN" />
<category android:name="android.intent.category.LUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Bienvenue" android:exported="false" android:label="@string/app_name">
<intent-filter>
<action android:name="com.maghribouna.amine.ters.Bienvenue" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".Histoire" android:exported="false" android:label="@string/app_name">
</activity>
我看不出添加其他代码的理由,所以错误必须出现在这些代码中!