简体   繁体   中英

I want to get some value from other class dynamicly for ex:

My code

 public class Data{
  Public class Friend{
public int[] jane = {somthing};
public int[] frank = {somthing};
public int[] john = {somthing};
}}

I wanna use this variable in other class like this:

class GetData{
int[] getName = Data."className"."friendName";
}
public class GetData{
int[] getName = Data."className"."friendName";
}

inherit the getdata class to your second class.

public class MainActivity extends AppCompatActivity implement GetData{
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

}

@android remote control, So, what you are trying to achieve, what do you mean by dynamic here? please be clear with your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM