How to change screen on a tap, in Android? -
How to change screen on a tap, in Android? -
i have simple android application - pretty much simple possible.
i have 2 different setcontentview calls. want sec 1 called after user taps on screen. works otherwise.
how view pop when user taps?
here mainactivity class:
package com.example.myfirstapp; import android.os.bundle; import android.app.activity; import android.content.intent; import android.view.menu; import android.view.view; import android.view.window; import android.view.windowmanager; import android.widget.edittext; public class mainactivity extends activity { public final static string extra_message = "com.example.myfirstapp.message"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.activity_main); setcontentview(r.layout.activity_main2); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); homecoming true; } } and here activity_main2:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:background="@drawable/corporatesplash" > </linearlayout>
so if undestand correctly there button on screen. if user clicks button, proper action beingness called (sendmessage). if user clicks area on screen apart button, other thing beingness called (setcontentview or w/e). correct?
if yes, advice create view, place under button, filling screen (for illustration in relativelayout). , add together ontouchlistener.
android tap
Comments
Post a Comment