0

So a few days ago I build an update for my custom android car tablet with my own launcher (based on Nexus 7 2013, Android 5.1.1). I added a few new features and some fixes (which have nothing to do we the activity that causes the problem), and I added accidentally the device admin permission together with the install packages permission.

After the update was installed on the tablet, the device opened always the Android for work app when clicked something which should start an external app (like Spotify or Maps). I thought it might be something with these permission and I deleted them and reinstalled a new version of the app (not updated!), but it didn't worked, it still started the Android for work app.

Then I uninstalled the Android for work app, and now the google now app started. After uninstalling it too, the settings app now launches?!

Has anyone an idea why this is happening and what I can do to get rid of it?

PS: Here is the code I am using to start an app using it's package name which is hundred percent right (there cannot be the failure):

pkg1 = prefs.getString("dash_app_music", null);

....

private View.OnClickListener clickhandler = new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_action_1:
                Intent i = pm.getLaunchIntentForPackage(pkg1);
                startActivity(i);
                break;
            case R.id.tv_action_2:
                Intent i2 = pm.getLaunchIntentForPackage(pkg2);
                startActivity(i2);
                break;
            case R.id.tv_back:
                onBackPressed();
                break;
        }
    }
};
Deniz Celebi
  • 888
  • 4
  • 14
  • 24

1 Answers1

0

Ok it came out that for some reason the package name for the packagemanager which gets the intent was empty and therefore android starts the settings app as a fallback(?).

Deniz Celebi
  • 888
  • 4
  • 14
  • 24