cr5315
Android Enthusiast
I have an RSS reader app that normally launches a new activity with information about the RSS item the user clicked on, but there are too many problems with that, so I'm just going to make the app launch the browser to the link of the article. I've tried take the code I already had and make it launch, but that didn't work.
When a user clicks on an item,
Which launches
I tried to make it launch the browser with keyLink, but that didn't work.
When a user clicks on an item,
Code:
Intent intent = new Intent(AndroidRssReader.this, ShowDetails.class);
Bundle bundle = new Bundle();
bundle.putString("keyTitle", myRssFeed.getItem(position).getTitle());
bundle.putString("keyDescription", myRssFeed.getItem(position).getDescription());
bundle.putString("keyLink", myRssFeed.getItem(position).getLink());
bundle.putString("keyPubdate", myRssFeed.getItem(position).getPubdate());
intent.putExtras(bundle);
startActivity(intent);
Which launches
Code:
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.details);
TextView detailsTitle = (TextView)findViewById(R.id.detailstitle);
TextView detailsDescription = (TextView)findViewById(R.id.detailsdescription);
TextView detailsPubdate = (TextView)findViewById(R.id.detailspubdate);
TextView detailsLink = (TextView)findViewById(R.id.detailslink);
Bundle bundle = this.getIntent().getExtras();
detailsTitle.setText(bundle.getString("keyTitle"));
detailsDescription.setText(bundle.getString("keyDescription"));
detailsPubdate.setText(bundle.getString("keyPubdate"));
detailsLink.setText(bundle.getString("keyLink"));
}
}
I tried to make it launch the browser with keyLink, but that didn't work.