0
Как получить или установить значение переменной многомерного массива при использовании глобального класса. пробовали различные способы не успехаandroid: Использование глобальной переменной многомерного массива в CustomView
мой Глобальный класс
public class Global extends Application {
private String [][][] myarray=new String[10][10][10];
public String[][][] getMyarray() {
return myarray;
}
public void setMyarray(String[][][] myarray) {
this.myarray = myarray;
}
}
моя активность:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new MyView(this));
}
class MyView extends View
{
public MyView(Context context) {
super(context);
final Global globalVariable = (Global) getApplicationContext();
//set the value for myarray[2][2][1]
(globalVariable).setMyarray[2][2][1]("me"); //<---- how?
// get the value of myarray [2][2][1]
final String name = globalVariable.getMyarray[2][2][1]; //<---- how?
}
}
}