-1
I have a Widget that there is only one configuration screen but want to add one more how can I do it? I know that the first screen that appears is a Activity try to open with Intent normal but not working.
I made this Intent:
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.activity_widget_configure_1);
final SharedPreferences Salvadados = getSharedPreferences(MontWidget, MODE_PRIVATE);
ListView lista_teste = (ListView)findViewById(R.id.lista_teste);
String[] dados = new String[]{"xxxx","xxxx","xxxxx"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, dados);
lista_teste.setAdapter(adapter);
lista_teste.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position){
case 0:
Intent nextConfig = new Intent(WidgetConfigureActivity.this, Widget_Configure_2.class);
startActivity(nextConfig);
finish();
break;
But I was unsuccessful.
Note that your code seems to have a syntax error, which is the lack of
;
between sentences. Was that a mistake when pasting here or is your code really like this? If it is, this may be the reason why.– user28595
Are you sure that the name of the other Activity is Widget_configure_2 ???
– Dev
Yes, that’s the name of the Activity I want to call
– João Vitor
Well... apparently this was supposed to work. You can show the rest of your code ?
– Dev
the next line is a Finish to close the screen and open the next
– João Vitor
face the Finish is not to close the screen... the Finish is to terminate the application.. Remove it
– Dev
Not it closes the Activity that is running and is in the widget the application nor this open I have already made the test commented the Finish and nothing happened
– João Vitor
Then do what I told you... post your entire code for analysis
– Dev
ready posted..
– João Vitor
Check your layouts for the Activity Widget_configure_2 created in XML.
– Dev
yes this maid
– João Vitor