fixed crash in settings

This commit is contained in:
Christian Schneppe 2018-03-21 21:16:36 +01:00
parent 84d4869572
commit d1632b84b3
4 changed files with 10 additions and 5 deletions

View file

@ -92,7 +92,8 @@ android {
applicationId "de.pixart.messenger"
multiDexEnabled true
buildConfigField("String", "UPDATE_URL", '"https://xmpp.pix-art.de/Pix-Art_Messenger/update/"')
resValue "string", "applicationId", applicationId
resValue "string", "app_name", "Pix-Art Messenger"
dimension "distribution"
}
@ -120,7 +121,8 @@ android {
open {
buildConfigField("String", "UPDATE_URL", '"https://xmpp.pix-art.de/Pix-Art_Messenger/update/open/"')
applicationId "de.pixart.openmessenger"
resValue "string", "applicationId", applicationId
resValue "string", "app_name", "Pix-Art Messenger"
dimension "distribution"
}
}

View file

@ -37,10 +37,14 @@ public class SettingsFragment extends PreferenceFragment {
}
public void setActivityIntent(final Intent intent) {
boolean wasEmpty = TextUtils.isEmpty(page);
if (intent != null) {
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
if (intent.getExtras() != null) {
this.page = intent.getExtras().getString("page");
if (wasEmpty) {
openPreferenceScreen(page);
}
}
}
}

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Pix-Art Messenger</string>
<string name="welcome_header" translatable="false">Pix-Art Messenger</string>
<string name="type_pc" translatable="false">Computer</string>
<string name="type_phone" translatable="false">Mobile phone</string>

View file

@ -68,7 +68,7 @@
<intent
android:action="android.intent.action.VIEW"
android:targetClass="de.pixart.messenger.ui.SettingsActivity"
android:targetPackage="de.pixart.messenger">
android:targetPackage="@string/applicationId">
<extra
android:name="page"
android:value="quiet_hours" />
@ -258,7 +258,7 @@
<intent
android:action="android.intent.action.VIEW"
android:targetClass="de.pixart.messenger.ui.SettingsActivity"
android:targetPackage="de.pixart.messenger">
android:targetPackage="@string/applicationId">
<extra
android:name="page"
android:value="expert" />