Tenho a seguinte chamada abaixo que está sendo chamada em um menu lateral, quando chega na ultima linha do código na hora de preencher a Tela está dando NullPointer não estou entendendo o porque eu criei essa outra tela, mais herdando a principal que eu precisava que o Layout dela seria diferente.
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_markets) {
DownloadGetMarkers downloadGetMarkers = new DownloadGetMarkers();
downloadGetMarkers.execute("https://bittrex.com/api/v1.1/public/getmarkets");
try {
List<Markets> listMarkets = (List<Markets>) downloadGetMarkers.get();
loadViewGetMarkets(listMarkets);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
} else if (id == R.id.nav_currencies) {
DownloadGetCurrencies downloadGetCurrencies = new DownloadGetCurrencies();
downloadGetCurrencies.execute("https://bittrex.com/api/v1.1/public/getcurrencies");
try {
List<Currencies> listCurrencies = (List<Currencies>) downloadGetCurrencies.get();
loadViewGetCurrencies(listCurrencies);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
} else if (id == R.id.nav_tickers) {
DownloadGetMarkers downloadGetMarkers = new DownloadGetMarkers();
downloadGetMarkers.execute("https://bittrex.com/api/v1.1/public/getmarkets");
DownloadGetTicker downloadGetTicker = new DownloadGetTicker();
downloadGetTicker.execute("https://bittrex.com/api/v1.1/public/getticker?market=", "BTC-LTC");
try {
List<Markets> listMarkets = (List<Markets>) downloadGetMarkers.get();
loadViewGetTickerMarket(listMarkets);
//Ticker ticker = (Ticker) downloadGetTicker.get();
//loadViewGetTicker(ticker);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
} /*else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}*/
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
protected void loadViewGetTickerMarket(List<Markets> listMarkets) {
ListView listView = (ListView) findViewById(R.id.listViewMarket);
String[] teste = new String[] {"Teste1", "Teste2"};
listView.setAdapter(new ArrayAdapter<String>(this, R.layout.content_bit_trex_market, teste));
}