4

I saw many posts like this How to change the icon and label of an app once it is installed? but any of those posts could give me the exact answer so as to solve my problem.

I used this but it only changes the action bar icon :

 Button appicon1;   
 appicon1.setOnClickListener(new OnClickListener(){

            @Override
            public void onClick(View v) {
                getActionBar().setIcon(R.drawable.ic_launcher);
            }

        });

Giving any examples will be highly appreciated.

Thanks in advance :)

Community
  • 1
  • 1
noobProgrammer
  • 1,443
  • 4
  • 14
  • 33
  • 1
    Does this answer your question? [How to change an application icon programmatically in Android?](https://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android) – Troy Jun 05 '20 at 18:18

1 Answers1

5

See this answer : https://stackoverflow.com/a/15249542/2337837 : The main idea is to modify your Activity section in AndroidManifest.xml, then create <activity-alias> for each of your icons, then set enable attribute for the appropriate activity-alias programmatically

Sachin Bahukhandi
  • 2,378
  • 20
  • 29
Zied R.
  • 4,964
  • 2
  • 36
  • 67