stanipintjuk / Silverfish

A simple and lightweight launcher for Android.
GNU General Public License v3.0
44 stars 17 forks source link

Phone app missing from app drawer #68

Closed thefzsalam closed 6 years ago

thefzsalam commented 6 years ago

The stock phone dialler app is not shown in any tabs of app drawer on my Samsung Galaxy J5 (2016). Contacts and Messages app are shown.

Lonami commented 6 years ago

Same. It happens because the app considers only the package name but not the fact that it might have several activities (the case with this application in particular). Fix: use package and activity name for that.

thefzsalam commented 6 years ago

Thanks for the insight. I might have time to look into that next week. 👍

thefzsalam commented 6 years ago

@Lonami, confirmed. That's the issue. Working on a fix. :)

Lonami commented 6 years ago

Awesome, thank you :D

thefzsalam commented 6 years ago

I have edited the dbmodels and SQLiteHelper to store activityName in addition to packageName in the SQLite database.

How to launch a specific activity of a package from here?

                Intent i = mPackageManager.getLaunchIntentForPackage(app.packageName.toString());
                if (i != null) {
                    // Sanity check (application may have been uninstalled)
                    // TODO Remove it from the database
                    mActivity.startActivity(i);
                }

I had also tried this:

                    mActivity.startActivity(new Intent(app.activityName.toString()));

But results in the following error:

02-19 21:54:39.029 25979-25979/com.launcher.silverfish E/AndroidRuntime: FATAL EXCEPTION: main
                                                                         Process: com.launcher.silverfish, PID: 25979
                                                                         android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.tapbase.LTEswitcher.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }
                                                                             at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1844)
                                                                             at android.app.Instrumentation.execStartActivity(Instrumentation.java:1531)
                                                                             at android.app.Activity.startActivityForResult(Activity.java:4411)
                                                                             at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
                                                                             at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
                                                                             at android.app.Activity.startActivityForResult(Activity.java:4369)
                                                                             at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
                                                                             at android.app.Activity.startActivity(Activity.java:4708)
                                                                             at android.app.Activity.startActivity(Activity.java:4676)
                                                                             at com.launcher.silverfish.launcher.appdrawer.AppArrayAdapter$2.onClick(AppArrayAdapter.java:104)
                                                                             at android.view.View.performClick(View.java:6312)
                                                                             at android.view.View$PerformClick.run(View.java:23985)
                                                                             at android.os.Handler.handleCallback(Handler.java:751)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                             at android.os.Looper.loop(Looper.java:154)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:6816)
                                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Lonami commented 6 years ago

Uhm did you try looking up online or experimenting on different places? See https://ddg.gg/android%20launch%20package%20specific%20activity

thefzsalam commented 6 years ago

I did try googling. I think I gave up too early. Thanks @Lonami :+1: Just learned that DuckDuckGo can do awesome stuffs like that.

Lonami commented 6 years ago

I'll try reviewing #71 once I have some time :)