Note that there are some explanatory texts on larger screens.

plurals
  1. POclick event on background image in android
    primarykey
    data
    text
    <p>i put click event on this click_screen</p> <pre><code>&lt;TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:onClick="click_screen" /&gt; </code></pre> <p>another activity's .java file (click_screen)</p> <pre><code>public void click_screen(View v) { Intent click_screen=new Intent(this, MainActivity.class); startActivity(click_screen); } </code></pre> <hr> <p>MainActivity.java</p> <pre><code>package com.amcct.amcostapp; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; public class MainActivity extends Activity { @SuppressLint("NewApi") protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } /* @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { Intent click_screen=new Intent(this, MainActivity.class); startActivity(click_screen); } return super.onTouchEvent(event); }*/ @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void click_screen(View v) { Intent click_screen=new Intent(this, MainActivity.class); startActivity(click_screen); } } </code></pre> <p>===================================================================== .xml when i click anywhere it generates ^^ above click_screen</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:onClick="click_screen" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".Click_Page" android:background="@drawable/img_1" &gt; &lt;/RelativeLayout&gt; </code></pre> <p>See this my All Files....</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.
 

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