2011-07-19 16 views
2

私のアプリから他のアプリのアクティビティを呼び出したいだから私は、次のコードAndroid:アンドロイドのアプリケーションから他のアプリケーションのアクティビティを呼び出す

Intent i = new Intent(); 
    i.setComponent(new ComponentName("com.android.DailyDeals", 
          "com.android.DailyDeals.TodaysDeals_AM")); 
    startActivity(i); 

を使用しています。しかし、私は例外次のようになっています:

Caused by: java.lang.SecurityException: Permission Denied: 
     starting Intent { cmp=com.android.DailyDeals/.TodaysDeals_AM } from 
     ProcessRecord{44f9b8b0 399:com.prabhu.android/10041} (pid=399, uid=10041) 
     requires null. 

これを解決する方法は?

答えて

2

これはあなたのJavaファイルにこのようなコードを作成するのに役立つと思います。

startActivity(new Intent("com.name of your class"));you have to write your package name .classname inside it. 
& also declare this activity into your **mainfest** file 

    <activity android:name=".name of your class" 
         android:label="@string/app_name"> 
       <intent-filter> 
        <action android:name="com.diffrentview.MYFILE" /> 
        <category android:name="android.intent.category.DEFAULT" /> 
       </intent-filter> 
      </activity> 
関連する問題