how can i call activity class from other java class?

后端 未结 2 864
温柔的废话
温柔的废话 2021-01-16 20:57

I have just started android.

I just want to know that how can i call activity class from other java class.

i just want to pass class object to activity class

2条回答
  •  无人共我
    2021-01-16 21:29

    import android.content.Context;
    import android.content.Intent;
    
    public class Genfunctions {
        public void menuActions(String title,Context ct){
    
            //this.context=context;
            switch (title){
                case "ENTRIES":
    
                    Intent intent = new Intent(ct, RptentrylistActivity.class);
                    ct.startActivity(intent);
                    break;
            }
        }//end of functions
    }
    

提交回复
热议问题