This is the code at the moment:
public class PizzeListino extends ActivityTabActivity { final Context context = this; @Override public void onCreate(Bundle SavedIstanceStatesavedInstanceState) { { super.onCreate(savedInstanceState); finaldeleteFile("Ordinazioni.txt"); String[] Secondi = getResources().getStringArraysetContentView(R.arraylayout.pizzeshow_listino); TabHost tabHost = getTabHost(); super.onCreate(SavedIstanceState);//Primi Intent intentPrimi = new setContentViewIntent(R).layoutsetClass(this, Primi.lista_primiclass); final ListViewTabSpec ListaPrimitabSpecPrimi = (ListView) findViewById(R.id.listView1);tabHost ArrayAdapter<String> arrayAdapter = .newTabSpec("Primi") new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, SecondisetIndicator("Primi"); ListaPrimi .setAdaptersetContent(arrayAdapterintentPrimi); //Secondi Intent intentSecondi = new ListaPrimiIntent().setOnItemClickListenersetClass(newthis, AdapterViewSecondi.OnItemClickListener(class); { TabSpec tabSpecSecondi = tabHost @Override.newTabSpec("Secondi") public.setIndicator("Secondi") void onItemClick(AdapterView<?> adapterView, View Vista, int Posizione, long id) { .setContent(intentSecondi); // Dolci StringIntent SelezionatointentDolci = new StringIntent().setClass(this, Dolci.class); TabSpec tabSpecDolci = tabHost Selezionato = (String) ListaPrimi.getItemAtPositionnewTabSpec(Posizione"Dolci"); Toast.makeText(getApplicationContextsetIndicator("Dolci"), Selezionato, Toast.LENGTH_SHORT).show(); .setContent(intentDolci); Selezionato += "\n"; // Pizze Intent intentPizze = new Intent().setClass(this, Pizze.class); TabSpec tabSpecPizze = tabHost try { .newTabSpec("Pizze") .setIndicator("Pizze") FileOutputStream fos = openFileOutput("Ordinazioni.txt",Context.MODE_APPEND | Context .MODE_PRIVATEsetContent(intentPizze); // Bevande DataOutputStreamIntent dosintentBevande = new DataOutputStreamIntent(fos).setClass(this, Bevande.class); TabSpec tabSpecBevande = tabHost dos.writeUTFnewTabSpec(Selezionato"Bevande"); .setIndicator("Bevande") dos .closesetContent(intentBevande); // Contorni } Intent intentContorni = new Intent().setClass(this, Bevande.class); catch (Exception e) { TabSpec tabSpecContorni = tabHost e.printStackTracenewTabSpec("Contorni"); } .setIndicator("Contorni") } .setContent(intentContorni); }tabHost.addTab(tabSpecPrimi); tabHost.addTab(tabSpecSecondi); }tabHost.addTab(tabSpecPizze); tabHost.addTab(tabSpecDolci); tabHost.addTab(tabSpecBevande); @Override } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.layoutmenu.opzioni_menu, menu); return true; } public boolean OnOptionsItemSelected(MenuItem item) { Toast.makeText(context, item.getItemId(), Toast.LENGTH_SHORT).show(); switch (item.getItemId()) { case R.id.fineordinazione: Intent intent = new Intent(context, AggiungiProdotto.class); startActivity(intent); return true; return true; case R.id.modificaordinazione: break; } return false; return false; } } } }
Aaaw.