Ciao, mi trovo davanti ad un problema che da solo sicuramente non riesco a risolvere. Attualmente, ho una classe che setta in display_activity le view
tra cui ho :codice:@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.display_activity);
e successivamete invio tutto al display adapter.codice:Cursor mcursor = dataBase.rawQuery("SELECT COUNT(turno) AS mutua FROM "+DbHelper.TURNI_TABLE+" WHERE MESE = 'Gennaio'and TURNO = 'M'", null); int colIndex1 = mcursor.getColumnIndex("mutua"); if (colIndex1 == -1) return; else mcursor.moveToFirst(); mutua = mcursor.getInt(colIndex1); System.out.println("La somma è "+mutua); turni_totore.add(mutua+""); Integer.toString(mutua); TextView text1 = (TextView) findViewById(R.id.txtmutua); text1.setText(mutua+""); Cursor scursor = dataBase.rawQuery("SELECT count(ore) AS str FROM "+DbHelper.TURNI_TABLE+" WHERE MESE = 'Gennaio'and ORE >='8'", null); int colIndex2 = scursor.getColumnIndex("str"); if (colIndex2 == -1) return; else scursor.moveToFirst(); str = scursor.getDouble(colIndex2); System.out.println("La somma è "+str); turni_str.add(str+""); Double.toString(str); TextView text2 = (TextView) findViewById(R.id.txtstr); text2.setText(totore-(str*8)+"");
Il mio problema e questo: vorrei passare l'out delle texview dal layout display_activity al layout main,pensndo di sfruttare findViewById ho inserito le relative textview sulla main e avviato l'app. a questo punto, mi sono reso conto che non funziona, ho meglio l'app funziona, ma nelle due view non mi visualizza nulla.
Ho pensato di inseriresubito dopo System.out ma così non va, come posso riuscire nel mio intento, passare le sole view mutua e str al layout main e mantenere il resto su display_acitivity. ?codice:setContentView(R.layout.main);

LinkBack URL
About LinkBacks
Rispondi quotando