Fixed bug where app shortcuts wouldn't work when app was already open
This commit is contained in:
parent
978d0716e0
commit
34f2f8b936
3 changed files with 19 additions and 2 deletions
|
|
@ -20,7 +20,8 @@
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Phonograph.Light"
|
android:theme="@style/Theme.Phonograph.Light"
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
<activity android:name=".ui.activities.MainActivity">
|
<activity android:name=".ui.activities.MainActivity"
|
||||||
|
android:launchMode="singleInstance">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<action android:name="android.intent.action.MUSIC_PLAYER" />
|
<action android:name="android.intent.action.MUSIC_PLAYER" />
|
||||||
|
|
@ -175,7 +176,7 @@
|
||||||
android:label="@string/report_an_issue" />
|
android:label="@string/report_an_issue" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".appshortcuts.AppShortcutLauncherActivity"
|
android:name=".appshortcuts.AppShortcutLauncherActivity"
|
||||||
android:exported="true" />
|
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
@ -268,6 +268,13 @@ public class MainActivity extends AbsSlidingMusicPanelActivity {
|
||||||
handlePlaybackIntent(getIntent());
|
handlePlaybackIntent(getIntent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Called when there's already an instance of MainActivity
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
handlePlaybackIntent(intent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (item.getItemId() == android.R.id.home) {
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,13 @@
|
||||||
<item name="android:transitionName" tools:ignore="NewApi">toolbar</item>
|
<item name="android:transitionName" tools:ignore="NewApi">toolbar</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Transparent" parent="android:Theme">
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<item name="android:windowIsFloating">true</item>
|
||||||
|
<item name="android:backgroundDimEnabled">false</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue