Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:47:10+00:00 2026-06-16T13:47:10+00:00

I am creating an android app wherein i want to add Twitter share button

  • 0

I am creating an android app wherein i want to add Twitter share button , on clicking the Twitter button will share something (Title + url) on twitter. I’m almost there, but I have a problem with the link. When I give two parameters with “&”, it won’t work. Please let me know if anyone has a suitable answer which i can implement. Answers will be really appreciated.

//Full URL: http://www.mywebsite.com/index.php?option=com_content&catid=40&id=12546&view=article**

String title = "Hello title";
String catid = "40";
String id = "12546";

Uri.Builder b = Uri.parse("http://www.mywebsite.com/").buildUpon();
    b.path("index.php");
    b.appendQueryParameter("option=com_content&catid", catid);
    b.appendQueryParameter("&id", id);
    b.appendQueryParameter("&view=article", null);
    b.build();

String url = b.build().toString(); 

String tweetUrl = "https://twitter.com/intent/tweet?text=" + title + "&url=" + url;

Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

Output: => “http://www.mywebsite.com/index.php?option=com_content&catid=40”

but the => “&id=12546&view=article” is missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:47:11+00:00Added an answer on June 16, 2026 at 1:47 pm

    You should not provide the ampersand (&) inside the first parameter of the “appendQueryParameter”, it will be added for you automatically. Use it as:

    b.appendQueryParameter("id", id); // instead of ("*&*id", id);
    b.appendQueryParameter("view=article", null); // instead of ("*&*view=article", null);
    

    And the output is going to be the one you expect

    https://twitter.com/intent/tweet?text=Hello title&url=http://www.mywebsite.com/index.php?option%3Dcom_content%26catid=40&id=12546&view%3Darticle=null
    

    See here an example of usage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an android app that will share content through twitter and i'm facing
I am creating an Android app and want to use SSO to make it
I'm creating an Android app, when a user clicks a button in the app
I am creating an Android app that will download and cache PDF files (the
I am creating an Android app that uses GPS. I want to prompt the
I'm creating an Android app that will be packaged and distributed in both lite
I'm creating my first android app that will make use of SQlite. I have
I am creating an iOS and Android app. The app will track the same
I'm creating an android app which will call a method which parses the selected
I have read that it will allow creating an Android app without (much) programming

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.