0
public class MainActivity extends BroadcastReceiver {
    WebView web1;
    WebView web2;
    Button btn;

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
        String action = intent.getAction();
        Log.i("U", "Action" + action);
    }
}



<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_REMOVED"/>
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.example2.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>
    </application>

This code i have to Get Information on log-cat if user Uninstall there action take place But in manifest file it is showing :
it showing Error : Permission is only granted to system apps how i will Fix this issue please help any other way to know that user Uninstall application from device .

user2794306
  • 175
  • 3
  • 5
  • 24

1 Answers1

0

From the documentation:

public static final String BROADCAST_PACKAGE_REMOVED
Allows an application to broadcast a notification that an application package has been removed.

It appears that you don't need this permission to just receive the broadcast.

Henry
  • 42,982
  • 7
  • 68
  • 84
  • Please Edit In my code so that i can Know application is uninstalling – user2794306 Oct 18 '13 at 06:29
  • See basically i have to remove registered device id from Our database who ever is not Using Our app i mean Uninstall? – user2794306 Oct 18 '13 at 06:30
  • I don't think you can get it for your own app. See for example http://stackoverflow.com/questions/8231853/notification-when-user-uninstalls-android-app or http://stackoverflow.com/questions/2680758/detect-if-an-app-was-uninstalled – Henry Oct 18 '13 at 06:38
  • Please write code for Get repsone if application get Uninstall just samall application plz – user2794306 Oct 18 '13 at 06:53