从一个程序的activity调到另一个程序的activity时,出现一下错误:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=MOBILE_WORKING_ANDROID_CLIENT_INTEGRATION }
调用程序的代码:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=MOBILE_WORKING_ANDROID_CLIENT_INTEGRATION }
调用程序的代码:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn_start = (Button) findViewById(R.id.btn_start); btn_start.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent("MOBILE_WORKING_ANDROID_CLIENT_INTEGRATION"); startActivity(intent); } }); }
被调用程序activity的xml配置:
<activity android:name="com.aktd.measure.MeasureOnPC300"> <intent-filter> <action android:name="MOBILE_WORKING_ANDROID_CLIENT_INTEGRATION"/> </intent-filter> </activity>
问一下这是怎么回事,有谁遇到过吗?
解决方案
8
<intent-filter>里面加个category试试?
12
通过startActivity()或 startActivityForResult()传入的implicit Intent在测试时Android自动包含了CATEGORY_DEFAULT,所以假如应用想要接收implicit Intent就必须包含 “android.intent.category.DEFAULT”.