2

I want to call other apps activity from my app. So I am using the following code

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

But I am getting following exception:

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.

How to resolve this?

Harry Joy
  • 58,650
  • 30
  • 162
  • 207
Prabhu M
  • 3,534
  • 8
  • 48
  • 87

1 Answers1

2

i think this will help you make code in your java file like this.

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>
Amandeep singh
  • 1,865
  • 7
  • 21
  • 41