o codigo do update é bem extenso ... mais acho que so o dom oncreate de ve servir
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
setContentView(R.layout.activity_acessoria);
dados = getIntent().getStringArrayExtra("dados");
Log.i("teste", "on create acessoria recebe dados do login" + dados.toString());
ActionBar actionBar = getActionBar();
actionBar.show();
actionBar.setDisplayHomeAsUpEnabled(true);
textoAcimaDaListaCategoria = (TextView) findViewById(R.id.TextViewListaCategoria);
listView = (ListView) findViewById(R.id.ListaMeses);
// getApplicationContext().getString(R.string.Url_WS)+"?NomeLogin="+dadosUsuario[0]+"&"+"SenhaCliente="+dadosUsuario[1];
WS = getApplicationContext().getString(R.string.Url_WS);
Log.i("teste", "WS : " + WS );
// faz o update automatico na primeira vez que acessar o aplicativo
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
if (settings.getBoolean("my_first_time", true)) {
// the app is being launched for first time, do something
Log.i("teste", "dentro do shared");
update(dados);
settings.edit().putBoolean("my_first_time", false).commit();
}
// update(dados);
CarregaMes();
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
Mes item = (Mes) listView.getAdapter().getItem(arg2);
mesClicadoId = Integer.toString(item.getId());
mesClicadoNome = item.getMes();
textoAcimaDaListaCategoria.setText(mesClicadoNome);
Log.i("teste", "clique na lista mes " + item.getId() +" :id::mes: " + item.getMes());
CarregaAcessorias(item.getId());
}
});
}// aqui fecha o oncreate