Change icon launcher and app name programmatically

noobProgrammer picture noobProgrammer · Mar 2, 2014 · Viewed 18.4k times · Source

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 :)

Answer

Zied R. picture Zied R. · Mar 2, 2014

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