mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Fix buggy selection logic. Changed behaviour to always launch the selection's containing page.
This commit is contained in:
@@ -92,14 +92,9 @@ public class C2DMReceiver extends C2DMBaseReceiver {
|
|||||||
} catch (ActivityNotFoundException e) {
|
} catch (ActivityNotFoundException e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (sel != null && sel.length() > 0) { // have selection
|
|
||||||
LauncherUtils.generateNotification(context, sel,
|
|
||||||
context.getString(R.string.copied_desktop_clipboard), launchIntent);
|
|
||||||
} else {
|
} else {
|
||||||
LauncherUtils.generateNotification(context, url, title, launchIntent);
|
LauncherUtils.generateNotification(context, url, title, launchIntent);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Record history (for link/maps only)
|
// Record history (for link/maps only)
|
||||||
if (launchIntent != null && launchIntent.getAction().equals(Intent.ACTION_VIEW)) {
|
if (launchIntent != null && launchIntent.getAction().equals(Intent.ACTION_VIEW)) {
|
||||||
|
|||||||
@@ -27,14 +27,6 @@ public class LauncherUtils {
|
|||||||
intent = new Intent(Intent.ACTION_DIAL,
|
intent = new Intent(Intent.ACTION_DIAL,
|
||||||
Uri.parse("tel:" + number));
|
Uri.parse("tel:" + number));
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
ClipboardManager cm =
|
|
||||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
cm.setText(number);
|
|
||||||
} else if (sel != null && sel.length() > 0) {
|
|
||||||
// No intent for selection - just copy to clipboard
|
|
||||||
ClipboardManager cm =
|
|
||||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
cm.setText(sel);
|
|
||||||
} else {
|
} else {
|
||||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
@@ -49,6 +41,13 @@ public class LauncherUtils {
|
|||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sel != null && sel.length() > 0) {
|
||||||
|
ClipboardManager cm =
|
||||||
|
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
cm.setText(sel);
|
||||||
|
}
|
||||||
|
|
||||||
return intent;
|
return intent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user