|
|
|
@ -631,15 +631,28 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
|
|
|
|
BroadcastReceiver receiver = new BroadcastReceiver() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
if (ACTION_VIEW_MESSAGES.equals(intent.getAction())) {
|
|
|
|
|
if (ACTION_VIEW_MESSAGES.equals(intent.getAction()))
|
|
|
|
|
onViewMessages(intent);
|
|
|
|
|
else if (ACTION_VIEW_MESSAGE.equals(intent.getAction()))
|
|
|
|
|
onViewMessage(intent);
|
|
|
|
|
else if (ACTION_EDIT_FOLDER.equals(intent.getAction()))
|
|
|
|
|
onEditFolder(intent);
|
|
|
|
|
else if (ACTION_STORE_ATTACHMENT.equals(intent.getAction()))
|
|
|
|
|
onStoreAttachment(intent);
|
|
|
|
|
else if (ACTION_ACTIVATE_PRO.equals(intent.getAction()))
|
|
|
|
|
onActivatePro(intent);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private void onViewMessages(Intent intent) {
|
|
|
|
|
FragmentMessages fragment = new FragmentMessages();
|
|
|
|
|
fragment.setArguments(intent.getExtras());
|
|
|
|
|
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
|
|
|
|
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("messages");
|
|
|
|
|
fragmentTransaction.commit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (ACTION_VIEW_MESSAGE.equals(intent.getAction())) {
|
|
|
|
|
|
|
|
|
|
private void onViewMessage(Intent intent) {
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected Void onLoad(Context context, Bundle args) {
|
|
|
|
@ -681,22 +694,25 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
|
|
|
|
Toast.makeText(ActivityView.this, ex.toString(), Toast.LENGTH_LONG).show();
|
|
|
|
|
}
|
|
|
|
|
}.load(ActivityView.this, intent.getExtras());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (ACTION_EDIT_FOLDER.equals(intent.getAction())) {
|
|
|
|
|
private void onEditFolder(Intent intent) {
|
|
|
|
|
FragmentFolder fragment = new FragmentFolder();
|
|
|
|
|
fragment.setArguments(intent.getExtras());
|
|
|
|
|
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
|
|
|
|
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("folder");
|
|
|
|
|
fragmentTransaction.commit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (ACTION_STORE_ATTACHMENT.equals(intent.getAction())) {
|
|
|
|
|
private void onStoreAttachment(Intent intent) {
|
|
|
|
|
Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
|
|
|
|
create.addCategory(Intent.CATEGORY_OPENABLE);
|
|
|
|
|
create.setType(intent.getStringExtra("type"));
|
|
|
|
|
create.putExtra(Intent.EXTRA_TITLE, intent.getStringExtra("name"));
|
|
|
|
|
startActivityForResult(create, (int) intent.getLongExtra("id", -1) + REQUEST_ATTACHMENT_OFFSET);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (ACTION_ACTIVATE_PRO.equals(intent.getAction())) {
|
|
|
|
|
private void onActivatePro(Intent intent) {
|
|
|
|
|
try {
|
|
|
|
|
Uri data = intent.getParcelableExtra("uri");
|
|
|
|
|
String challenge = getChallenge();
|
|
|
|
@ -721,8 +737,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
|
|
|
|
Toast.makeText(ActivityView.this, ex.getMessage(), Toast.LENGTH_LONG).show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
|
|