Small improvements

pull/147/head
M66B 6 years ago
parent 2d386392de
commit 074629c071

@ -65,6 +65,7 @@ public class ActivityCompose extends ActivityBilling implements FragmentManager.
Intent.ACTION_SENDTO.equals(action) ||
Intent.ACTION_SEND.equals(action) ||
Intent.ACTION_SEND_MULTIPLE.equals(action)) {
Log.i(intent.toString());
Log.logExtras(intent);
args = new Bundle();

@ -10,6 +10,8 @@ import android.text.Spanned;
import android.view.View;
import android.widget.TextView;
import com.google.android.material.snackbar.Snackbar;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@ -55,10 +57,18 @@ public class ActivityEml extends ActivityBase {
args.putParcelable("uri", uri);
new SimpleTask<Result>() {
@Override
protected void onPostExecute(Bundle args) {
pbWait.setVisibility(View.GONE);
}
@Override
protected Result onExecute(Context context, Bundle args) throws Throwable {
Uri uri = args.getParcelable("uri");
if ("file".equals(uri.getScheme()))
throw new IllegalArgumentException(context.getString(R.string.title_no_stream));
Result result = new Result();
InputStream is = null;
@ -119,11 +129,13 @@ public class ActivityEml extends ActivityBase {
tvBody.setText(result.body);
tvEml.setText(result.eml);
grpEml.setVisibility(View.VISIBLE);
pbWait.setVisibility(View.GONE);
}
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG).show();
else
Helper.unexpectedError(ActivityEml.this, ActivityEml.this, ex);
}
}.execute(this, args, "eml");

Loading…
Cancel
Save