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 3345852
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:14:04+00:00 2026-05-18T01:14:04+00:00

Hai Friends, I want to invoke or fire the onclick event for Table Row

  • 0

Hai Friends,
I want to invoke or fire the onclick event for Table Row when the user clicked a particular table row in the UI.
This is my xml code

  <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/table_bars" android:layout_width="wrap_content" android:layout_height="fill_parent"android:background="@drawable/corner" android:stretchColumns="1" android:layout_margin="10dp">
  <TableRow>
  <TextView android:id="@+id/barsp_baradd_value"
  android:textSize="15sp" android:padding="10dp" android:layout_width="wrap_content" />
   </TableRow>
   <View android:layout_height="1dp" android:background="#FF909090" />
   <TableRow>
   <TextView android:id="@+id/barsp_barphone_value"
             android:textSize="15sp"    android:padding="10dp" android:layout_width="wrap_content" />
    <ImageView android:id="@+id/san_arrow2" android:src="@drawable/newforward" android:layout_alignParentRight="true"
android:adjustViewBounds="true" android:layout_marginTop="10dp"
android:layout_width="30dp"  android:layout_height="35dp" android:paddingRight="4dp" />
 </TableRow>
  <View android:layout_height="1dp" android:background="#FF909090" />
  <TableRow android:id="@+id/barsite">
   <TextView android:id="@+id/barsp_barsite_value"
  android:textSize="15sp" android:padding="10dp" android:layout_width="wrap_content" />
<ImageView android:id="@+id/san_arrow3" android:src="@drawable/newforward" android:layout_alignParentRight="true"
android:adjustViewBounds="true" android:layout_marginTop="10dp"
android:layout_width="30dp"  android:layout_height="35dp" android:paddingRight="4dp" />
                  </TableRow>

                </TableLayout>

and my Java code is

TableRow row = (TableRow)findViewById(R.id.row1);

                row.setOnClickListener(new OnClickListener() {



                                @Override
                 public void onClick(View v) {

                                // TODO Auto-generated method stub

                                try {

                                        //Log.v(TAG, "try");

                                        uri = Uri.parse("geo:0,0?q=" + VALUE_baraddress1[0] + ", "

                                                        + VALUE_baraddress2[0] + ", "

                                                        + VALUE_baraddress3[0]);

                                        //Log.v(TAG, VALUE_baraddress1[0] + ", "

                                                //      + VALUE_baraddress2[0] + ", "

                                                //      + VALUE_baraddress3[0]);

                                       startActivity(new Intent(Intent.ACTION_VIEW, uri));

                                } catch (Exception e) {

                                        //Log.v(TAG, "catch");

                                        uri = Uri.parse("geo:0,0?q=" + VALUE_baraddress1[0] + ", "

                                                        + VALUE_baraddress3[0]);

                                        //Log.v(TAG, VALUE_baraddress1[0] + ", "

                                        //              + VALUE_baraddress3[0]);

                                        startActivity(new Intent(Intent.ACTION_VIEW, uri));



                                }



                        }

                });



i had got null pointer exception in this line

TableRow row = (TableRow)table.getChildAt(0);

Logcat Messages

11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     ... 11 more
11-10 15:47:04.164: ERROR/AndroidRuntime(12720): Caused by: java.lang.NullPointerException
11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     at com.fsp.blacksheep.BS_Bars.onCreate(BS_Bars.java:546)
11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
11-10 15:47:04.164: ERROR/AndroidRuntime(12720):     ... 19 more
11-10 15:47:06.324: ERROR/JavaBinder(972): !!! FAILED BINDER TRANSACTION !!!
  • 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-05-18T01:14:05+00:00Added an answer on May 18, 2026 at 1:14 am

    I’m not quite sure if that even works but you should set the android:clickable attribute to true if you are planing to have the TableRows clickable. I haven’t tried it tho.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hai friends...my java file indicate this error: R.styleable cannot be resolved.... my xml file:
Hai Friends, I want to display a toast message to the user, when there
hai friends i am having the table like this TBLKEY EMPKEY EMPNAME ----------- ------------------------------
Hai i want to generated an automated click event. I am working in php
Hai presently i have grid like this. <Grid Name=tGrid1 Grid.Row=0 Background=Black > </Grid> <Grid
Hai friends I need user country when they visit my php website. According to
Hai all, I want to know how to disable row header in Devexpress xtragrid
Hai I am using the following code to access columns in a row but
hai friends In my application i want to send sms using nokia 3310c mobile
Hai Friends, I want to know what is the best alternative to J2ME. When

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.