use of android.content.ActivityNotFoundException in project Klyph by jonathangerbaud.
the class FeedBackActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
ImageView companyLogo = (ImageView) findViewById(R.id.company_logo);
Button suggestButton = (Button) findViewById(R.id.suggest_button);
Button bugButton = (Button) findViewById(R.id.bug_button);
Button gPlusButton = (Button) findViewById(R.id.bug_g_plus);
setTitle(R.string.menu_feedback);
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background_transparent_gradient));
suggestButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { getString(R.string.feedback_support_mail_address) });
intent.putExtra(Intent.EXTRA_SUBJECT, "Suggest feedback " + getString(R.string.about_version, ApplicationUtil.getAppVersion(FeedBackActivity.this)));
intent.putExtra(Intent.EXTRA_TEXT, "");
startActivity(Intent.createChooser(intent, getString(R.string.feedback_send_mail)));
}
});
bugButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { getString(R.string.feedback_support_mail_address) });
intent.putExtra(Intent.EXTRA_SUBJECT, "Bug feedback " + getString(R.string.about_version, ApplicationUtil.getAppVersion(FeedBackActivity.this)));
intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(new StringBuilder().append("<p>Android Version : " + Build.VERSION.RELEASE + " (Api Level " + Build.VERSION.SDK_INT + ")</p>").append("<p>Device model : " + Build.BRAND + " " + Build.MODEL + "</p>").toString()));
startActivity(Intent.createChooser(intent, getString(R.string.feedback_send_mail)));
}
});
gPlusButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.google_plus_community_url))));
} catch (ActivityNotFoundException e) {
PhoneUtil.openURL(FeedBackActivity.this, getString(R.string.google_plus_community_url));
}
}
});
companyLogo.setClickable(true);
companyLogo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PhoneUtil.openURL(FeedBackActivity.this, getString(R.string.company_url));
}
});
}
use of android.content.ActivityNotFoundException in project SmartAndroidSource by jaychou2012.
the class FacebookHandle method startSingleSignOn.
private boolean startSingleSignOn(Activity activity, String applicationId, String permissions, int activityCode) {
boolean didSucceed = true;
Intent intent = new Intent();
intent.setClassName("com.facebook.katana", "com.facebook.katana.ProxyAuth");
intent.putExtra("client_id", applicationId);
if (permissions != null) {
intent.putExtra("scope", permissions);
}
if (!validateAppSignatureForIntent(activity, intent)) {
return false;
}
try {
activity.startActivityForResult(intent, activityCode);
} catch (ActivityNotFoundException e) {
didSucceed = false;
}
return didSucceed;
}
use of android.content.ActivityNotFoundException in project Android-Terminal-Emulator by jackpal.
the class Term method doEmailTranscript.
private void doEmailTranscript() {
TermSession session = getCurrentTermSession();
if (session != null) {
// Don't really want to supply an address, but
// currently it's required, otherwise nobody
// wants to handle the intent.
String addr = "user@example.com";
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + addr));
String subject = getString(R.string.email_transcript_subject);
String title = session.getTitle();
if (title != null) {
subject = subject + " - " + title;
}
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, session.getTranscriptText().trim());
try {
startActivity(Intent.createChooser(intent, getString(R.string.email_transcript_chooser_title)));
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.email_transcript_no_email_activity_found, Toast.LENGTH_LONG).show();
}
}
}
use of android.content.ActivityNotFoundException in project SeriesGuide by UweTrottmann.
the class ShareUtils method startShareIntentChooser.
/**
* Share a text snippet. Displays a share intent chooser with the given title, share type is
* text/plain.
*/
public static void startShareIntentChooser(Activity activity, String message, @StringRes int titleResId) {
IntentBuilder ib = ShareCompat.IntentBuilder.from(activity);
ib.setText(message);
ib.setChooserTitle(titleResId);
ib.setType("text/plain");
try {
ib.startChooser();
} catch (ActivityNotFoundException e) {
// no activity available to handle the intent
Toast.makeText(activity, R.string.app_not_available, Toast.LENGTH_LONG).show();
}
}
use of android.content.ActivityNotFoundException in project Fairphone by Kwamecorp.
the class LauncherTransitionable method onClickVoiceButton.
/**
* Event handler for the voice button
*
* @param v
* The view that was clicked.
*/
public void onClickVoiceButton(View v) {
v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
try {
final SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
ComponentName activityName = searchManager.getGlobalSearchActivity();
Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (activityName != null) {
intent.setPackage(activityName.getPackageName());
}
startActivity(null, intent, "onClickVoiceButton");
} catch (ActivityNotFoundException e) {
Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivitySafely(null, intent, "onClickVoiceButton");
}
}
Aggregations