anotherim/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java

39 lines
952 B
Java
Raw Normal View History

2017-12-07 20:59:13 +00:00
package eu.siacs.conversations.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();
}
}