Fixed TNEF FAQ ref

pull/187/head
M66B 5 years ago
parent 293142793a
commit a979846b79

@ -396,6 +396,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
super.startActivityForResult(intent, requestCode); super.startActivityForResult(intent, requestCode);
} catch (ActivityNotFoundException ex) { } catch (ActivityNotFoundException ex) {
Log.w(ex); Log.w(ex);
if (Helper.isTnef(intent.getType()))
Helper.viewFAQ(this, 155);
else
ToastEx.makeText(this, getString(R.string.title_no_viewer, intent), Toast.LENGTH_LONG).show(); ToastEx.makeText(this, getString(R.string.title_no_viewer, intent), Toast.LENGTH_LONG).show();
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);

@ -526,22 +526,11 @@ public class Helper {
} }
} else } else
context.startActivity(intent); context.startActivity(intent);
} else { } else
try {
context.startActivity(intent); context.startActivity(intent);
} catch (ActivityNotFoundException ex) {
if (isTnef(type))
viewFAQ(context, 155);
else {
String message = context.getString(R.string.title_no_viewer,
type != null ? type : name != null ? name : file.getName());
ToastEx.makeText(context, message, Toast.LENGTH_LONG).show();
}
}
}
} }
private static boolean isTnef(String type) { static boolean isTnef(String type) {
// https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format // https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format
return ("application/ms-tnef".equals(type) || return ("application/ms-tnef".equals(type) ||
"application/vnd.ms-tnef".equals(type)); "application/vnd.ms-tnef".equals(type));

Loading…
Cancel
Save