Error in when Displaying Status with twitter4j
Question
Getting these error when I run the android application:
Instead of getting the statuses Im getting one status that says "JSON EXCEPTiON". Im also getting these errors in the elogcat.
01-22 15:39:09.783: E/Twitter(468): Error retrieving tweets 01-22 15:39:09.783: E/Twitter(468): 404:The URI requested is invalid or the resource requested, such as a user, does not exists. 01-22 15:39:09.783: E/Twitter(468): {"error":"Not found","request":"/1/null/lists/0/statuses.json?page=1"}
This code was working great. But then e I put icons on my listview(The menu before I show the statuses...) . I am getting the error somewhere over here:
Any ideas?
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Activity activity = (Activity) getContext();
LayoutInflater inflater = activity.getLayoutInflater();
// Inflate the views from XML
View rowView = inflater.inflate(R.layout.image_text_layout, null);
JSONObject jsonImageText = getItem(position);
ImageView imageview =(ImageView)rowView.findViewById(R.id.last_build_stat);
try {
String date = (String)jsonImageText.get("tweetDate");
String avatar = (String)jsonImageText.get("avatar");
imageview.setImageBitmap(getBitmap(avatar));
} catch (JSONException e) {
e.printStackTrace();
}
// Set the text on the TextView
TextView textView = (TextView) rowView.findViewById(R.id.job_text);
try {
String tweet = (String)jsonImageText.get("tweet");
String auth = (String)jsonImageText.get("author");
//String date = (String)jsonImageText.get("tweetDate");
if (date.length()>0){
String latest = tweet + "<br><br><i>" + auth + " - " + date + "</i>";
//String latest = tweet;
textView.setText(Html.fromHtml(latest));
} else {
textView.setText(Html.fromHtml(tweet) + "\n" + Html.fromHtml(auth));
}
} catch (JSONException e) {
textView.setText("JSON Exception");
}
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow