There are 2 classes. It is necessary in class 2, to perform the method of 1. The method itself:

public void FLYNOTE_refresh(){ SharedPreferences Pref = getSharedPreferences("nnote", MODE_WORLD_READABLE); key = Pref.getInt("number", 0); String lv_arr[] = new String[key]; for (int i = 0; i < key; i++){ lv_arr[i] = Pref.getString("n" + i, "none"); noten = i; } textView1.setText(String.valueOf(key)); listView1.setAdapter( new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , lv_arr)); listView1.setTextFilterEnabled(true); } listView1.setTextFilterEnabled(true); } 

How I call it:

 Client client = new Client(); client.FLYNOTE_refresh(); 

The application throws an error.

  • one of the classes is definitely related to activations. Is the calling class also related to activations? If yes, then your code cannot work - because you are trying to apply to a non-existent activation at the moment. - KoVadim
  • I thought so. What then advise? I do not want to do a timer here, to update the data. - romanzi
  • Show me a mistake ... - Gorets
  • In short, it is clear that the method will not be working at all, since your method does not accept or return anything to you, you try to update it in another activation text - that's the error - Gorets
  • @Gorets how do you know that the second class he is talking about (Client) is not inside the first class (Activation) - LackOfKnowledge

1 answer 1

 public static void FLYNOTE_refresh(Context c, TextView tv, ListView ...){ // Тело фунцции } // Вызов функции [Имя_класса(не экземпляра)].FLYNOTE_refresh(...); 
  • will not help him - Gorets
  • Speech was not about 2x activit. Although it is not very clear from the code what classes are we talking about. In a certain situation, my way is working. In another situation, you can use handlers. - LackOfKnowledge 1:46 pm
  • Just something 2 activities ( - romanzi
  • Top active transparent chtoli? Why update the bottom activit in it - LackOfKnowledge
  • Transparent Activation? And the definition is possible?)) Is this the type of dialogue? or activating with the topic of dialogue?)) In short, Roma, lay out your 2nd activations, tell me what you want and tell you what's wrong - Gorets