java - Why Dialer app opens Contacts app - Android Studio custom launcher -


i've built custom launcher android, have issue on samsung phone. when try open dialer app opens samsung's contact app. on emulator works fine, think problem on phone. how can fix it?

this code set packages in main activity.

public void setpackages(){     final intent mainintent = new intent(intent.action_main, null);     mainintent.addcategory(intent.category_launcher);     list<resolveinfo> packageslist = packagemanager.queryintentactivities(mainintent, 0);     packages = new package[packageslist.size()];     (int = 0; < packageslist.size(); i++){         packages[i] = new package(packageslist.get(i).loadicon(packagemanager), packageslist.get(i).loadlabel(packagemanager).tostring());         packages[i].seticon(packageslist.get(i).loadicon(packagemanager));         packages[i].setappname(packageslist.get(i).activityinfo.packagename);         packages[i].setlabel(packageslist.get(i).loadlabel(packagemanager).tostring());     }     new utils().changesort(packages);     draweradapter = new draweradapter(this, packages);     gridview.setadapter(draweradapter);     gridview.setnumcolumns(sharedpreferences.getint("drawer_grid_columns", 4));     gridview.setonitemclicklistener(new drawerclicklistener(this, packages, packagemanager, gridview)); } 

this custom gridview adapter.

public class draweradapter extends baseadapter {  context mcontext; package[] packforadapter;   public draweradapter(context context, package pack[]){     mcontext = context;     packforadapter = pack; }  @override public int getcount() {     return packforadapter.length; }  @override public object getitem(int i) {     return null; }  @override public long getitemid(int i) {     return 0; }  static class viewholder{     textview labeltext;     imageview iconimage; }  @override public view getview(int i, view view, viewgroup viewgroup) {     viewholder viewholder;     layoutinflater layoutinflater = (layoutinflater) mcontext.getsystemservice(context.layout_inflater_service);     sharedpreferences sharedpreferences= preferencemanager.getdefaultsharedpreferences(mcontext);     float iconsize = 0, labelsize = 0;     if (sharedpreferences.getint("drawer_grid_columns", 4) == 4){         iconsize = mcontext.getresources().getdimension(r.dimen.icon_app_size_4);     } else if (sharedpreferences.getint("drawer_grid_columns", 4) == 5){         iconsize = mcontext.getresources().getdimension(r.dimen.icon_app_size_5);     } else if (sharedpreferences.getint("drawer_grid_columns", 4) == 6){         iconsize = mcontext.getresources().getdimension(r.dimen.icon_app_size_6);     }     labelsize = mcontext.getresources().getdimension(r.dimen.label_app_size);     if (view == null){         view = layoutinflater.inflate(r.layout.drawer_grid_item, null);         viewholder = new viewholder();         viewholder.labeltext = (textview) view.findviewbyid(r.id.label_text);         viewholder.iconimage = (imageview) view.findviewbyid(r.id.icon_image);         view.settag(viewholder);     } else {         viewholder = (viewholder) view.gettag();     }      viewholder.iconimage.setimagedrawable(packforadapter[i].geticon());     viewholder.iconimage.getlayoutparams().height = (int)iconsize;     viewholder.iconimage.getlayoutparams().width = (int)iconsize;     viewholder.labeltext.settext(packforadapter[i].getlabel());     viewholder.labeltext.settextsize(labelsize);     return view; } 

}


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -