Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud
this week in the
Cloud/Virtualization
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Android
Activity layout: insert a Hyperlink to open in the browser?
Leonidas Savvides
Ranch Hand
Posts: 403
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Anywhere I may insert a BUTTON in an Activity layout, I Can insert a Hyperlink(
string
underlined to get clicked) to open in the browser?
how hyperlinks can created...?
what's the equivalent of button:
<Button android:id="@+id/newTagButton" android:layout_width="@dimen/tagButtonWidth" android:layout_height="wrap_content" />
Button newTagButton = (Button) newTagView.findViewById(R.id.newTagButton); newTagButton.setText(tag); newTagButton.setOnClickListener(queryButtonListener); ..................................................................................................... ..................................................................................................... // load selected search in a web browser public OnClickListener queryButtonListener = new OnClickListener() { @Override public void onClick(View v) { // get the query String buttonText = ((Button)v).getText().toString(); String query = savedSearches.getString(buttonText, null);//"" // create the URL corresponding to the touched Button's query String urlString = getString(R.string.searchURL) + query; // create an Intent to launch a web browser Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString)); startActivity(webIntent); // execute the Intent } // end method onClick }; // end OnClickListener anonymous inner class
zoheb hassan
Ranch Hand
Posts: 154
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Linkify should help you, there are examples in api demos that should help you
Regards,
Zoheb
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Why error in this code
Screen changing
ERROR/AndroidRuntime(921): java.lang.StackOverflowError (if you have multiple activities)
shows me blank with blinking arrow
force closes
More...