Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Unable to click buttons on running android app

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Unable to click buttons on running android app

    Hello

    Me again.

    I finally managed to get my application working on my phone.

    Problem now is:

    The application shows, but I cannot click anywhere. This means that none of my events fire - it is as if something is blocking them. I suspect it is one of my layouts.

    My layout looks like :

    design.jpg

    Mu Outline looks like :

    outline.png

    So now, after some research, I did this in the .xml file :

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/fullscreen_content_controls"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        tools:context=".FullscreenActivityNCC"
        android:clickable="true"
        android:focusable="true" >
        <requestFocus />

    But I am still unable to activate any click event. I do have listeners for them and they worked last time I tested.

    Any advice?

    Hannes


  2. #2
    Junior Member
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Re: Unable to click buttons on running android app

    My two layouts look as follows :

    activity_fullscreen_activity_ncc.xml
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/fullscreen_content_controls"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        tools:context=".FullscreenActivityNCC"
        android:clickable="true"
        android:focusable="true" >
        <requestFocus />
     
     
        <!--
             The primary full-screen view. This can be replaced with whatever view
             is needed to present your content, e.g. VideoView, SurfaceView,
             TextureView, etc.
        -->
     
     
        <!--
             This FrameLayout insets its children based on system windows using
             android:fitsSystemWindows.
        --><Button
            android:id="@+id/Contact"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|left"
            android:text="@string/Contact"
            android:textColor="#000000" />
     
        <Button
            android:id="@+id/Download"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|right"
            android:text="@string/Download"
            android:textColor="#000000" />
     
        <FrameLayout
            android:id="@+id/fullscreen_content"
            android:layout_width="match_parent"
            android:layout_height="407dp" 
               android:clickable="true"
        android:focusable="true">
     
            <ImageView
                android:id="@+id/Image2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/downloadprogress" />
     
            <include
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|center_horizontal"
                android:layout_marginBottom="50dp"
                android:layout_marginTop="30dp"
                layout="@layout/literacy" />
     
            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="52dp"
                android:gravity="center_vertical|center_horizontal"
                android:text="@string/WelcomeBrowse"
                android:textColor="#000000" />
     
            <TextView
                android:id="@+id/textView2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:gravity="center_vertical|center_horizontal"
                android:text="@string/ContactNCC"
                android:textAlignment="center"
                android:textColor="#FF0000" />
     
        </FrameLayout>
     
    </FrameLayout>

    literacy.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" >
     
        <ListView
            android:id="@+id/srListView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.24" />
     
    </LinearLayout>

    Can you see if any of these overlap, causing me not to be able to click anywhere?

    Or, am I on the wrong track?

    Hannes

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Re: Unable to click buttons on running android app

    I deleted the SystemUiHider stuff and now everything works!!!!!

    Thanks for any attempts to help me

    Hannes

  4. #4

    Default Re: Unable to click buttons on running android app

    Could it be a problem with the touch screen itself?

Similar Threads

  1. Replies: 3
    Last Post: June 5th, 2013, 02:46 PM
  2. Need a java code to click similar buttons on a web page
    By kalawadh in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 9th, 2013, 12:23 PM
  3. My app audio sounds different when running the app?
    By TP-Oreilly in forum Android Development
    Replies: 1
    Last Post: January 29th, 2012, 08:23 AM
  4. Hello World Android App
    By TP-Oreilly in forum Android Development
    Replies: 6
    Last Post: January 22nd, 2012, 08:01 PM
  5. Unable to launch app of java application
    By sharmaneelam in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 19th, 2010, 08:42 AM