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:
@@ -93,12 +93,7 @@ public class C2DMReceiver extends C2DMBaseReceiver {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (sel != null && sel.length() > 0) { // have selection
|
||||
LauncherUtils.generateNotification(context, sel,
|
||||
context.getString(R.string.copied_desktop_clipboard), launchIntent);
|
||||
} else {
|
||||
LauncherUtils.generateNotification(context, url, title, launchIntent);
|
||||
}
|
||||
LauncherUtils.generateNotification(context, url, title, launchIntent);
|
||||
}
|
||||
|
||||
// Record history (for link/maps only)
|
||||
|
||||
@@ -27,14 +27,6 @@ public class LauncherUtils {
|
||||
intent = new Intent(Intent.ACTION_DIAL,
|
||||
Uri.parse("tel:" + number));
|
||||
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 {
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -49,6 +41,13 @@ public class LauncherUtils {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user