how can i call activity class from other java class?

后端 未结 2 865
温柔的废话
温柔的废话 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:28

    Have a look at the documentation: http://developer.android.com/reference/android/app/Activity.html

    specifically startActivity and startActivityForResult

    0 讨论(0)
  • 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
    }
    
    0 讨论(0)
提交回复
热议问题