mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-21 13:18:52 +01:00
Error handling for conversation that can't be opened
This commit is contained in:
@@ -8,6 +8,7 @@ import android.util.Log;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import com.crashlytics.android.Crashlytics;
|
||||||
import com.moez.QKSMS.R;
|
import com.moez.QKSMS.R;
|
||||||
import com.moez.QKSMS.common.DonationManager;
|
import com.moez.QKSMS.common.DonationManager;
|
||||||
import com.moez.QKSMS.mmssms.Utils;
|
import com.moez.QKSMS.mmssms.Utils;
|
||||||
@@ -81,7 +82,28 @@ public class MessageListActivity extends QKSwipeBackActivity {
|
|||||||
.replace(R.id.content_frame, fragment)
|
.replace(R.id.content_frame, fragment)
|
||||||
.commitAllowingStateLoss();
|
.commitAllowingStateLoss();
|
||||||
} else {
|
} else {
|
||||||
// TODO log crashlytics event and show toast
|
String msg = "Couldn't open conversation: {action:";
|
||||||
|
msg += intent.getAction();
|
||||||
|
msg += ", data:";
|
||||||
|
msg += intent.getData() == null ? "null" : intent.getData().toString();
|
||||||
|
msg += ", scheme:";
|
||||||
|
msg += intent.getData() == null ? "null" : intent.getData().getScheme();
|
||||||
|
msg += ", extras:{";
|
||||||
|
Object[] keys = intent.getExtras().keySet().toArray();
|
||||||
|
for (int i = 0; i < keys.length; i++) {
|
||||||
|
String key = keys[i].toString();
|
||||||
|
msg += keys[i].toString();
|
||||||
|
msg += ":";
|
||||||
|
msg += intent.getExtras().get(key);
|
||||||
|
if (i < keys.length - 1) {
|
||||||
|
msg += ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msg += "}}";
|
||||||
|
Log.d(TAG, msg);
|
||||||
|
Crashlytics.log(msg);
|
||||||
|
makeToast(R.string.toast_conversation_error);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -632,6 +632,7 @@
|
|||||||
<!--Toast shown when Google Play Services is not available for purchasing a product-->
|
<!--Toast shown when Google Play Services is not available for purchasing a product-->
|
||||||
<string name="toast_endlessjabber_not_installed">EndlessJabber is not installed, opening Google Play</string>
|
<string name="toast_endlessjabber_not_installed">EndlessJabber is not installed, opening Google Play</string>
|
||||||
<string name="toast_changelog_error">Couldn\'t load the changelog. Please try again later</string>
|
<string name="toast_changelog_error">Couldn\'t load the changelog. Please try again later</string>
|
||||||
|
<string name="toast_conversation_error">Couldn\'t open conversation</string>
|
||||||
|
|
||||||
<!--Toast shown to thank user for donating-->
|
<!--Toast shown to thank user for donating-->
|
||||||
<string name="thanks_1">Thank you for donating! You\'re my new best friend.</string>
|
<string name="thanks_1">Thank you for donating! You\'re my new best friend.</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user