Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <RelativeLayout 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"
- tools:context=".MainActivity" >
- <Button
- android:id="@+id/imageButtonHomeSelector"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/icon_home_config"
- android:onClick="imageButtonHomeSelector"
- />
- <WebView
- android:id="@+id/webView1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="96dp" />
- </RelativeLayout>
- public class MainActivity extends Activity {
- private Button Homebutton, LoginButton, SettingButton;
- public void onCreate(Bundle savedInstanceState) {
- final Context context = this;
- super.onCreate(savedInstanceState);
- setContentView(R.layout.webview);
- Intent intent = new Intent(getApplicationContext(), WebViewActivity.class);
- startActivity(intent);
- addListenerHomeButton();
- // addListenerLoginButton();
- // addListenerSettingButton();
- }
- public void addListenerHomeButton() {
- Homebutton = (Button) findViewById(R.id.imageButtonHomeSelector);
- Homebutton.setFocusable(true);
- Homebutton.setFocusableInTouchMode(true);
- Homebutton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- Intent intent = new Intent(getApplicationContext(), WebViewActivity.class);
- startActivity(intent);
- }
- });
- }
- LoginButton = (Button) findViewById(R.id.imageButtonLoginSelector);
- // LoginButton.setFocusable(true);
- LoginButton.setFocusableInTouchMode(true);
- LoginButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
- startActivity(intent);
- }
- });
- }
- public void addListenerSettingButton() {
- SettingButton = (Button) findViewById(R.id.imageButtonSettingSelector);
- SettingButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- Intent intent = new Intent(getApplicationContext(), SettingActivity.class);
- startActivity(intent);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement