fix #186, properly handle clicking missed call notifications

This commit is contained in:
tibbi
2021-05-22 23:11:15 +02:00
parent a23f89541f
commit 32d8831831
2 changed files with 16 additions and 2 deletions

View File

@@ -42,7 +42,14 @@
<activity
android:name=".activities.MainActivity"
android:configChanges="orientation|screenSize" />
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="vnd.android.cursor.dir/calls" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.simplemobiletools.commons.activities.AboutActivity"

View File

@@ -258,7 +258,14 @@ class MainActivity : SimpleActivity() {
// selecting the proper tab sometimes glitches, add an extra selector to make sure we have it right
main_tabs_holder.onGlobalLayout {
Handler().postDelayed({
main_tabs_holder.getTabAt(getDefaultTab())?.select()
var wantedTab = getDefaultTab()
// open the Recents tab if we got here by clicking a missed call notification
if (intent.action == Intent.ACTION_VIEW) {
wantedTab = main_tabs_holder.tabCount - 1
}
main_tabs_holder.getTabAt(wantedTab)?.select()
invalidateOptionsMenu()
}, 100L)
}