Clickable links

73 views
Skip to first unread message

Peleke

unread,
Mar 9, 2011, 12:15:12 PM3/9/11
to android-appwidget-extensions
Can you please add a "Clickable link" feature to your API? Launcher
Pro Plus does it already but with an internal API.
Would be nice for all.

Florian Sundermann

unread,
Mar 9, 2011, 12:25:17 PM3/9/11
to android-appwid...@googlegroups.com
I guess there is no need for: you can have any child "clickable" or
doesn't it fit your needs?

2011/3/9 Peleke <f.nied...@gmail.com>:

Frederik Niedernolte

unread,
Mar 9, 2011, 12:38:25 PM3/9/11
to android-appwid...@googlegroups.com
Sorry but I am not a developer.
I only would like to see clickable links in scrollable widgets like it is already possible in the Launcher Pro Plus Friends widget for example.
Francois Deslandes (the developer of the famous messenger/calendar widgets) told me:

"
Make it possible to click on links / videos which are embedded in posts from Facebook / Twitter directly
>>> not technically possible within the scrollable widget (don't forget that Launcher use his own private internal API, not the open source scrollable widget API we developped)."

That's why I am asking...

schrieb Florian Sundermann:

Francois DESLANDES

unread,
Mar 9, 2011, 12:48:59 PM3/9/11
to android-appwid...@googlegroups.com
Hi Frederik and Florian,

Frederik, thanks for your note, Koxx = Francois Deslandes ;)

In fact we are talking about support of 2 things :

1. AUTOLINK
 android:autoLink="web"
in TextView used in scrollable list.

Currently, it doesn't works (TextView item clickable or not) :/


Here is the exception in case of autolink URL if you use a LauncherIntent.Extra.Scroll.Types.TEXTVIEWHTML :

03-09 18:42:04.403: WARN/dalvikvm(13446): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446): FATAL EXCEPTION: main
03-09 18:42:04.413: ERROR/AndroidRuntime(13446): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.app.ContextImpl.startActivity(ContextImpl.java:621)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.text.style.URLSpan.onClick(URLSpan.java:62)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.widget.TextView.onTouchEvent(TextView.java:6862)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.View.dispatchTouchEvent(View.java:3885)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.os.Looper.loop(Looper.java:123)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at android.app.ActivityThread.main(ActivityThread.java:3683)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at java.lang.reflect.Method.invokeNative(Native Method)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at java.lang.reflect.Method.invoke(Method.java:507)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-09 18:42:04.413: ERROR/AndroidRuntime(13446):     at dalvik.system.NativeStart.main(Native Method)
03-09 18:42:04.423: WARN/ActivityManager(97):   Force finishing activity org.adw.launcher/.Launcher


2. HTML LINK TAG

If you use classic HTML tags for the text your provide to your TEXTVIEWHTML element, it render something similar to a clickable link, but the link click doesn't react.
you can try to put only "<a href=\"http://www.google.com\">Link text</a>" in the text view.




2011/3/9 Frederik Niedernolte <f.nied...@gmail.com>



--
Francois Deslandes @ Pure widgets - Android widgets

Francois DESLANDES

unread,
Mar 9, 2011, 12:50:01 PM3/9/11
to android-appwid...@googlegroups.com
the first point is not very important because it's really ugly to put an autolink (url are often too long)
the second is much more important.

2011/3/9 Francois DESLANDES <kox...@gmail.com>

Florian Sundermann

unread,
Mar 9, 2011, 4:01:19 PM3/9/11
to android-appwid...@googlegroups.com
To fixup method 2 we need to call "setMovementMethod" on the Textview
with LinkMovementMethod.getInstance() as parameter. But it might be
better to write an own MovementMethod to handle this touch event cause
it might be a security hole to call any url from the launcher context.
(But I don't know for sure, I have to look at the code of the
LinkMovementMethod first to tell if it is a problem).
That should be the technical part but how should it be integrated to
the API? maybe a activateTextviewHyperlinks(TextViewId) for the
remoteviews?

2011/3/9 Francois DESLANDES <kox...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages