Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:14:25+00:00 2026-06-12T19:14:25+00:00

I am aware that this question has been asked before, but I have tried

  • 0

I am aware that this question has been asked before, but I have tried every “solution” to the other questions, but I still have not been able to achieve what I am trying to do. I have searched and searched, and tried and tried. Please forgive me. I simply want to display my row of buttons above my WebView, so that it is consistent with the rest of the activities in my app (they all have the row of buttons at the top). It seems like I have tried every possible combination of layouts, but to no avail. It displays correctly in the Graphical Layout (Eclipse), but on the phone and emulator it only displays the WebView, fullscreen, no buttons…. Any help will be very much appreciated!

Here’s my xml:

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:orientation="horizontal" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/menu_panel">


                    <ImageButton
                        android:id="@+id/bHomeMenu"
                        android:layout_margin="-8dip"
                        android:layout_width="65dp"
                        android:layout_height="90dp"
                        android:background="@drawable/menu_btn_hcu_light_blue"
                        android:src="@drawable/icon_menu_home"
                        android:adjustViewBounds="true"
                        android:scaleType="centerInside"
                        style="@style/ButtonText"
                        android:textSize="13sp"
                        android:text="Home" />

                    <ImageButton
                        android:id="@+id/bItsMe247Menu"
                        android:layout_toRightOf="@+id/bHomeMenu"
                        android:layout_margin="-8dip"
                        android:layout_width="65dp"
                        android:layout_height="90dp"
                        android:background="@drawable/menu_btn_selected_hcu_light_blue"
                        android:src="@drawable/icon_menu_login"
                        android:adjustViewBounds="true"
                        android:scaleType="centerInside"
                        style="@style/ButtonText"
                        android:textSize="13sp"
                        android:text="It'sMe" />

                    <ImageButton
                        android:id="@+id/bFindUsMenu"
                        android:layout_toRightOf="@+id/bItsMe247Menu"
                        android:layout_margin="-8dip"
                        android:layout_width="65dp"
                        android:layout_height="90dp"
                        android:background="@drawable/menu_btn_hcu_light_blue"
                        android:src="@drawable/icon_menu_find_us"
                        android:adjustViewBounds="true"
                        android:scaleType="centerInside"
                        style="@style/ButtonText"
                        android:textSize="13sp"
                        android:text="FindUs" />

                    <ImageButton
                        android:id="@+id/bEmailMenu"
                        android:layout_toRightOf="@+id/bFindUsMenu"
                        android:layout_margin="-8dip"
                        android:layout_width="65dp"
                        android:layout_height="90dp"
                        android:background="@drawable/menu_btn_hcu_light_blue"
                        android:src="@drawable/icon_menu_email"
                        android:adjustViewBounds="true"
                        android:scaleType="centerInside"
                        style="@style/ButtonText"
                        android:textSize="13sp"
                        android:text="Email" />

                    <ImageButton
                        android:id="@+id/bRatesMenu"
                        android:layout_toRightOf="@+id/bEmailMenu"
                        android:layout_margin="-8dip"
                        android:layout_width="65dp"
                        android:layout_height="90dp"
                        android:background="@drawable/menu_btn_hcu_light_blue"
                        android:src="@drawable/icon_menu_rates"
                        android:adjustViewBounds="true"
                        android:scaleType="centerInside"
                        style="@style/ButtonText"
                        android:textSize="13sp"
                        android:text="Rates" />




    </LinearLayout>


                        <WebView xmlns:android="http://schemas.android.com/apk/res/android"
                            android:id="@+id/wvItsMe"
                            android:layout_width="fill_parent"
                            android:layout_height="0dp"
                            android:layout_weight="1" />


</LinearLayout>

EDIT: Here’s my java code, and a note below it:

    package com.dummyapp.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

import com.dummyapp.app.SimpleGestureFilter.SimpleGestureListener;

public class ItsMe247 extends Activity implements SimpleGestureListener{

    private SimpleGestureFilter detector;

    private WebView itsMeLogin;

//  ImageButton menuHome, menuFindUs, menuEmail, menuRates;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.itsme247);

//      menuHome = (ImageButton)findViewById(R.id.bHomeMenu);
//      menuFindUs = (ImageButton)findViewById(R.id.bFindUsMenu);
//      menuEmail = (ImageButton)findViewById(R.id.bEmailMenu);
//      menuRates = (ImageButton)findViewById(R.id.bRatesMenu);



        detector = new SimpleGestureFilter(this,this);

        itsMeLogin = new WebView(this);

        Toast.makeText(this, "Just Swipe To Exit", Toast.LENGTH_LONG).show();


        itsMeLogin.getSettings().setJavaScriptEnabled(true); // JavaScript enabled

        getWindow().requestFeature(Window.FEATURE_PROGRESS); // Show progress bar of page loading

        final Activity itsMeActivity = this;


        itsMeLogin.setWebChromeClient(new WebChromeClient() {

            public void onProgressChanged(WebView view, int progress){

                // Activities and WebViews measure progress with different scales.
                // The progress meter will automatically disappear when we reach 100%
                itsMeActivity.setProgress(progress * 100);

            }

        });

        itsMeLogin.setWebViewClient(new WebViewClient(){

            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl){

                Toast.makeText(itsMeActivity, "Oh no! " + description, Toast.LENGTH_SHORT).show();

            }


        });

        itsMeLogin.loadUrl("http://www.google.com");
        setContentView(itsMeLogin);


//      itsMeLogin.setWebViewClient(new WebViewClient() {
//          @Override
//          public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
//              return super.shouldOverrideUrlLoading(view, url);
//          }
//      });



//******************* MENU BUTTONS START HERE ********************************************************//        

//      menuRates.setOnClickListener(new View.OnClickListener() {
//          
//          public void onClick(View v) {
//              // TODO Auto-generated method stub
//              Intent ratesIntent = new Intent(ItsMe247.this, Rates.class);
//              ItsMe247.this.startActivity(ratesIntent);
//              
//          }
//          
//      });
//      
//      
//      menuFindUs.setOnClickListener(new View.OnClickListener() {
//          
//          public void onClick(View v) {
//              // TODO Auto-generated method stub
//              Intent contactIntent = new Intent(ItsMe247.this, Contact.class);
//              ItsMe247.this.startActivity(contactIntent);
//              
//          }
//      });
//      
//      menuEmail.setOnClickListener(new View.OnClickListener() {
//          
//          public void onClick(View v) {
//              // TODO Auto-generated method stub
//              Intent emailIntent = new Intent(ItsMe247.this, Email.class);
//              ItsMe247.this.startActivity(emailIntent);
//              
//
//          }
//      });
//      
//      menuHome.setOnClickListener(new View.OnClickListener() {
//          
//          public void onClick(View v) {
//              // TODO Auto-generated method stub
//              Intent itsMeIntent = new Intent(ItsMe247.this, MainActivity.class);
//              ItsMe247.this.startActivity(itsMeIntent);
//          }
//      });


//***************************** MENU BUTTONS END HERE ********************************************************//


    }//end onCreate method


    @Override 
      public boolean dispatchTouchEvent(MotionEvent me){ 
        this.detector.onTouchEvent(me);
       return super.dispatchTouchEvent(me); 
      }


        public void onSwipe(int direction) {

                   switch (direction) {

                   case SimpleGestureFilter.SWIPE_RIGHT: 

                       Intent funIntent = new Intent(ItsMe247.this, MainActivity.class);
                       ItsMe247.this.startActivity(funIntent);
                       //ItsMe247.this.finish();

                       break;

                   case SimpleGestureFilter.SWIPE_LEFT:  

                       Intent funIntent2 = new Intent(ItsMe247.this, Contact.class);
                       ItsMe247.this.startActivity(funIntent2);
                       //ItsMe247.this.finish();

                       break;

                   case SimpleGestureFilter.SWIPE_DOWN:  

                       break;

                   case SimpleGestureFilter.SWIPE_UP:   

                       break;                                               
                   } 

        }//end onSwipe method

      public void onDoubleTap() {

      }


}

I have all the menu buttons commented out (the buttons I’m trying to get to display above webview) until I finally get them to display through the xml. However, whenever I UNcomment the buttons and their listeners, the app crashes when trying to enter this activity.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:14:27+00:00Added an answer on June 12, 2026 at 7:14 pm

    Your code isn’t using your XML layout, you’re creating your own WebView in code and setting that as the view so it bypasses your XML completely.

    I’ve provided a few changes here that should make it work. Pay particular attention to the setContentView line and the following line, these are what use the XML layout. You may need to change the name of the layout (R.layout.whatever) and the webview id (R.id.webview). There may be a few parse errors from me putting it here, might have missed a closing bracket. I deleted much of your commented out code just to keep it simple.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    
        super.onCreate(savedInstanceState);
    
        setContentView( R.layout.xmlLayout );
    
        itsMeLogin = (WebView)findViewById( R.id.webview );
    
        detector = new SimpleGestureFilter(this,this);
    
        Toast.makeText(this, "Just Swipe To Exit", Toast.LENGTH_LONG).show();
    
    
        itsMeLogin.getSettings().setJavaScriptEnabled(true); // JavaScript enabled
    
        getWindow().requestFeature(Window.FEATURE_PROGRESS); // Show progress bar of page loading
    
        final Activity itsMeActivity = this;
    
    
        itsMeLogin.setWebChromeClient(new WebChromeClient() {
    
            public void onProgressChanged(WebView view, int progress){
    
                // Activities and WebViews measure progress with different scales.
                // The progress meter will automatically disappear when we reach 100%
                itsMeActivity.setProgress(progress * 100);
    
            }
    
        });
    
        itsMeLogin.setWebViewClient(new WebViewClient(){
    
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl){
    
                Toast.makeText(itsMeActivity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
    
            }
    
    
        });
    
        itsMeLogin.loadUrl("http://www.google.com");
    }
    

    Here’s my XML file from a similar layout as well, though yours will probably work with the edited code.

    <?xml version="1.0" encoding="utf-8"?>
    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:columnCount="3"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
    >
    <EditText
        android:ems="4"
        android:imeOptions="actionNext"
        android:inputType="number"
        android:layout_gravity="center_horizontal"
        android:maxLength="4"
        android:selectAllOnFocus="true"
    />
    <EditText
        android:ems="4"
        android:imeOptions="actionDone"
        android:inputType="textCapCharacters|textNoSuggestions"
        android:layout_gravity="center_horizontal"
        android:maxLength="3"
        android:selectAllOnFocus="true"
    />
    <Button android:id="@+id/submit"
    />
    <WebView android:id="@+id/webview"
        android:layout_columnSpan="3"
        android:layout_gravity="fill"
        android:layout_height="0dp"
        android:layout_width="0dp"
    />
    </GridLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm well aware that variants of this question have been asked before, but I
I'm aware that this question may have been asked before, but I still haven't
I'm aware that this question has been asked before. I have looked through them
I am fully aware that this question has been asked many times but I
I am aware that similar questions to this have been asked, but I have
This question has been asked before on SO, but most of those questions were
Yes, I'm aware that this question has already been post, but ... I'm looking
I apologize if this question has been asked before, but my case is a
I'm aware that this question has been asked a number of time on SO
I'm fully aware that this question has been asked and answered everywhere, both on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.