blob: 1229aae2e392d5de178c29812be5d7b15fb900d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package de.pixart.messenger.ui;
import android.app.Activity;
import android.content.Intent;
public class UriHandlerActivity extends Activity {
@Override
public void onStart() {
super.onStart();
handleIntent(getIntent());
}
@Override
public void onNewIntent(Intent intent) {
handleIntent(intent);
}
private void handleIntent(Intent data) {
if (data == null) {
finish();
return;
}
switch (data.getAction()) {
case Intent.ACTION_VIEW:
case Intent.ACTION_SENDTO:
final Intent intent = new Intent(getApplicationContext(),
StartConversationActivity.class);
intent.setAction(data.getAction());
intent.setData(data.getData());
intent.setAction(data.getAction());
startActivity(intent);
}
finish();
}
}
|