Android Code The App is not opening, whenever i run the app the error occurred unfortunately the tables for children has stopped. The app installed in AVD Manager properly. But not running.
public class MainActivity extends AppCompatActivity
{
EditText ed;
Button b;
ListView li;
int table[]= new int[11];
ListAdapter arrayAdapter;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
click();
}
public void click() {
ed = (EditText) findViewById(R.id.editText);
b = (Button) findViewById(R.id.button);
li = (ListView) findViewById(R.id.listView);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
int number = Integer.parseInt(ed.getText().toString());
if (number > 0)
{
for (int a = 1; a <= 12; a++)
{
table[a] = a * number;
}
}
}
});
arrayAdapter = new ArrayAdapter<Integer>(this, android.R.layout.simple_list_item_1, table['a']);
li.setAdapter(arrayAdapter);
}
}