Created
May 6, 2012 20:43
-
-
Save javimb/2624292 to your computer and use it in GitHub Desktop.
Cagada con adapters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javimb.camarero; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.ListView; | |
public class TableListActivity extends Activity { | |
ListView list; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.tablelist); | |
list = (ListView) findViewById(R.layout.tablelist); | |
/* Esto era lo que me daba la NullPointerException | |
Un fin de semana entero perdido por esta tonteria... | |
Cambiando la enterior linea por la siguiente que esta comentada funciona correctamente*/ | |
//list = (ListView) findViewById(R.id.tablesListView); | |
generateList(); | |
} | |
private void generateList(){ | |
CamareroApp app = (CamareroApp) getApplication(); | |
list.setAdapter(new TableAdapter(app.getTables())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment