Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to start Activity from a class( this class extends LinearLayout ) in Android 4.3?
    primarykey
    data
    text
    <p>I have two class , one is <code>public class range extends LinearLayout</code>.</p> <p>Another one is <code>public class Main extends Activity</code></p> <p>In the <strong>Main</strong> , I use <code>MyWindowManager.createBigWindow(getApplicationContext());</code> to call the <strong>range class</strong>.</p> <p>The range class:</p> <pre><code>public class Out_of_range extends LinearLayout { public static int viewWidth; public static int viewHeight; public Out_of_range(final Context context) { super(context); // TODO Auto-generated constructor stub LayoutInflater.from(context).inflate(R.layout.out_of_range, this); View view = findViewById(R.id.big_window_layout); viewWidth = view.getLayoutParams().width; viewHeight = view.getLayoutParams().height; TextView text = (TextView)findViewById(R.id.text); text.setText("loss :"+ Main.tempAddress); Button back = (Button)findViewById(R.id.back); back.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub /*---------------------------------------------------------------------------------------------- //I want to start Activity when I click the button here. final Intent mainintent = new Intent(getContext(), Main.class); startActivity(mainintent); */----------------------------------------------------------------------------------------------- } }); } </code></pre> <p>And I want to start Activity from a class( this class extends LinearLayout )</p> <p>I use intent , but it has error.</p> <p><strong>The method startActivity(Intent) is undefined for the type new View.OnClickListener(){}</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload