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

  • SEARCH
  • Home
  • 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 8662055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:38:37+00:00 2026-06-12T16:38:37+00:00

My task is to create app that could get latest tweets from x account.

  • 0

My task is to create app that could get latest tweets from x account.
Here is my code what I’ve made. However I get result (more than 0) only if i set (as search string) my account name. Otherwise I get nothing. Could someone explain me why? I will appreciate for any help.

private ListView lv;
private EditText et;
private ArrayAdapter<String> adapter;
String[] values;
private Token token = null;
private Credential c = null;
private UserAccountManager m = null;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    lv = (ListView) findViewById(R.id.listView1);
    et = (EditText) findViewById(R.id.editText1);
    et.setText("twapime");

    doRest();// first run, initialization, first search

}

private void doRest() {
    initAccount();
    initSearching();
}

private void initSearching() {
    ArrayList<String> listax = getSearchResults(et.getText().toString());
    initListViewAdapter(listax);
}

private void initListViewAdapter(ArrayList<String> listax) {
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, android.R.id.text1, listax);
    lv.setAdapter(adapter);

}

private void initAccount() {
    token = new Token("xxxx",
            "xxxx");
    c = new Credential("xxxx",
            "xxxx", token);

    m = UserAccountManager.getInstance(c);
}

private ArrayList<String> getSearchResults(String userTwitter) {
    ArrayList<String> lista = new ArrayList<String>();

    try {
        if (m.verifyCredential()) {

            SearchDevice sd = SearchDevice.getInstance();
            Query q1 = QueryComposer.from(userTwitter);

            Tweet[] ts = sd.searchTweets(q1);
            System.out.println(ts.length);

            for (int i = 0; i < ts.length; i++) {

                lista.add(ts[i].getString(MetadataSet.TWEET_CONTENT));
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    } catch (LimitExceededException e) {
        e.printStackTrace();
    }

    return lista;
}

public void btnSearcher(View w) {//OnClickListener
    initSearching();
}
  • 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-12T16:38:38+00:00Added an answer on June 12, 2026 at 4:38 pm

    I think it happens when someone block public information data for untrusted user.

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

Sidebar

Related Questions

I have a task to create a desktop version of our web app that
Background I have a web app that will create an image from user input.
I got handed the task to create a Windows Phone app and i am
I am working on a task that needs to checkout source from a github
I've got a Rails app with blog entries that I want to update from
I am trying to figure out how to accomplish the following task: Create a
I want to create Task in Google Calendar using Google Calendar API.Using C#. Looking
I've been given the task to create a simple Silverlight chat box for two
I was recently given a task to create a blog using Ruby on Rails.
I have a content type Task, where we create task for ourself or user

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.