forked from upstream-mirrors/quik
Use single instance of MessageListActivity
This commit is contained in:
@@ -81,7 +81,8 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.messagelist.MessageListActivity"
|
android:name=".ui.messagelist.MessageListActivity"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize"
|
||||||
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<action android:name="android.intent.action.SEND" />
|
<action android:name="android.intent.action.SEND" />
|
||||||
|
|||||||
@@ -45,29 +45,32 @@ public class MessageListActivity extends QKSwipeBackActivity {
|
|||||||
setContentView(R.layout.activity_fragment);
|
setContentView(R.layout.activity_fragment);
|
||||||
showBackButton(true);
|
showBackButton(true);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
onNewIntent(getIntent());
|
||||||
if (intent != null) {
|
}
|
||||||
mThreadId = intent.getLongExtra(ARG_THREAD_ID, -1);
|
|
||||||
mRowId = intent.getLongExtra(ARG_ROW_ID, -1);
|
|
||||||
mHighlight = intent.getStringExtra(ARG_HIGHLIGHT);
|
|
||||||
mShowImmediate = intent.getBooleanExtra(ARG_SHOW_IMMEDIATE, false);
|
|
||||||
|
|
||||||
if (mThreadId == -1 && intent.getData() != null) {
|
@Override
|
||||||
String data = intent.getData().toString();
|
protected void onNewIntent(Intent intent) {
|
||||||
String scheme = intent.getData().getScheme();
|
super.onNewIntent(intent);
|
||||||
|
mThreadId = intent.getLongExtra(ARG_THREAD_ID, -1);
|
||||||
|
mRowId = intent.getLongExtra(ARG_ROW_ID, -1);
|
||||||
|
mHighlight = intent.getStringExtra(ARG_HIGHLIGHT);
|
||||||
|
mShowImmediate = intent.getBooleanExtra(ARG_SHOW_IMMEDIATE, false);
|
||||||
|
|
||||||
String address = null;
|
if (mThreadId == -1 && intent.getData() != null) {
|
||||||
if (scheme.startsWith("smsto") || scheme.startsWith("mmsto")) {
|
String data = intent.getData().toString();
|
||||||
address = data.replace("smsto:", "").replace("mmsto:", "");
|
String scheme = intent.getData().getScheme();
|
||||||
} else if (scheme.startsWith("sms") || (scheme.startsWith("mms"))) {
|
|
||||||
address = data.replace("sms:", "").replace("mms:", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
address = URLDecoder.decode(address);
|
String address = null;
|
||||||
address = "" + Html.fromHtml(address);
|
if (scheme.startsWith("smsto") || scheme.startsWith("mmsto")) {
|
||||||
address = PhoneNumberUtils.formatNumber(address);
|
address = data.replace("smsto:", "").replace("mmsto:", "");
|
||||||
mThreadId = Utils.getOrCreateThreadId(this, address);
|
} else if (scheme.startsWith("sms") || (scheme.startsWith("mms"))) {
|
||||||
|
address = data.replace("sms:", "").replace("mms:", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
address = URLDecoder.decode(address);
|
||||||
|
address = "" + Html.fromHtml(address);
|
||||||
|
address = PhoneNumberUtils.formatNumber(address);
|
||||||
|
mThreadId = Utils.getOrCreateThreadId(this, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mThreadId != -1) {
|
if (mThreadId != -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user