Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » expiration in a class
icon1.gif   expiration in a class [message #1255921] Mon, 24 February 2014 19:09
Eclipse UserFriend
Hello there,

i want to make an expiration in a short form.

I want to take this code:

@Override
	public boolean onOptionsItemSelected(MenuItem Item) {

		switch (Item.getItemId()) {

		case R.id.item1:
			Intent Aktionitem1 = new Intent(this, FirstActivity.class);
			startActivity(Aktionitem1);
			return true;

		case R.id.item2:
			Intent Aktionitem2 = new Intent(this, SecondActivity.class);
			startActivity(Aktionitem2);
			return true;

		case R.id.item3:
			Intent Aktionitem3 = new Intent(this, SettingsActivity.class);
			startActivity(Aktionitem3);
			return true;
		default:
			return super.onOptionsItemSelected(Item);
		}

	}



in a class. So that i must edit it onces and it was updatet in every Activity.

Its like an Script for menues. The Main-Script calls this menu-Script every Time.

In simple. I just want to outsource the code.

Do you have any Idea.

Sorry if my English is not so good. Im German.
But i give my best.
Previous Topic:Re: error 404 for downloading Graphical Editing Framework (GEF)
Next Topic:How does the JUnit Runner calculate the default classpath it runs with?
Goto Forum:
  


Current Time: Thu Apr 17 21:24:09 EDT 2025

Powered by FUDForum. Page generated in 0.03092 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top