cr5315
Android Enthusiast
I've got an app that uses a toggle button to decide whether to launch an activity or the browser on a button click, but when ever I start the activity, Eclipse gives me errors in the Debug tab.
The toggle button is also in a different activity than the one giving me troubles.
The trouble code
I know it's this code because when I take it out, the app works just fine.
The Eclipse errors
I cant seem to think of any solutions to this.
The toggle button is also in a different activity than the one giving me troubles.
The trouble code
Code:
final ToggleButton togglebutton = (ToggleButton) findViewById(R.id.toggleButton1);
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
if (togglebutton.isChecked()) {
Intent intent = new Intent(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);
} else {
Bundle bundle = new Bundle();
bundle.putString("keyLink", myRssFeed.getItem(position).getLink());
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(bundle.getString("keyLink")));
startActivity(i);
}
I know it's this code because when I take it out, the app works just fine.
The Eclipse errors
I cant seem to think of any solutions to this.