How to add text to buttons in table layout and retrieve that text in android developement of tictactoe -


Text after "div class =" itemprop = "text">

Where did I want to put a tablelayout and button inside that tablerow and I wanted to put some text on that button that one such Android application As I click and at the end of time, to retrieve the data what I have put in.

This is basically Tic Tac toe. Please help me with somebody This is my first Android app. I have previously done TICTalk toe programming in basic Java code, just on the Android app Trying

`

  & lt; TableRow Android:. Android: layout_height = "match_parent" Android: layout_weight = "1" Android: gravity = "center" & gt; id = & Lt; Button android: id = "@ + id / Button1" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: layout_marginBottom = "2dp" Android: layout_marginLeft = "2dp" Android: layout_weight = "1" Android: Background = "#FFFFF" /> Android: Android: Layout_width = "Match_parent" Android: Layout_height = "Match_parent" Android layout _ Marjinbotm = "2 DP" Android: Leaut_margin = "2 DP" Android: Leaut_vet = "1" android: background = "# Fffff" / & gt; Android: Android: Android: Android: layout_width = "match_perrent" Android: layout_heck = "match_perrent" Android: layout_merginbottom = "2dp" Android: layout_margin left = "2dpp" Android: layout_weight = "1" Android: background = "# FFFFF "/> & Lt; / TableRow & gt; & Lt; TableRow android: id = "@ + id / tableRow2" Android: Layout_width = "Match_parent" Android: Layout_height = "Match_parent" Android: layout_weight = "1" android: gravity = "center" & gt; Android: Android: Android: Android: layout_width = "match_perrent" Android: layout_heck = "match_perrent" Android: layout_merginbottom = "2dp" Android: layout_margin = "2dpp" Android: layout_weight = "1" Android: background = "#ffff "/> & Lt; Button android: id = "@ + id / button5" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: layout_marginBottom = "2dp" Android: layout_marginLeft = "2dp" Android: layout_weight = "1" Android: Background = "#FFFFF" /> Android: Android: Layout_width = "Match_parent" Android: Layout_height = "Match_parent" Android: Leaut_mrjinbotm = "2 DP" Android: Leaut_margin = "2 DP" Android: Leaut_vet = "1" android: background = "# Fffff" / & gt ; & Lt; / TableRow & gt; & Lt; TableRow Android: Eddie = "@ + id / Teblrv 3" Android: Leaut_vidth = "Mac_perent" Android: Leaut_heit = "Mac_perent" Android: Leaut_vet = "1" Android: Gravity = "center" & gt; & Lt; Button android: id = "@ + id / button7" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: layout_marginBottom = "2dp" Android: layout_marginLeft = "2dp" Android: layout_weight = "1" Android: Background = "#FFFFF" /> & Lt; Button android: id = "@ + id / button8" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: layout_marginBottom = "2dp" Android: layout_marginLeft = "2dp" Android: layout_weight = "1" Android: Background = "#FFFFF" /> & Lt; Button android: id = "@ + id / button9" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: layout_marginBottom = "2dp" Android: layout_marginLeft = "2dp" Android: layout_weight = "1" Android: Background = "#FFFFF" /> & Lt; / TableRow & gt; & Lt; / TableLayout & gt;  

To re-activate the OnClick listener on activity, re / P> < p> Then in xml you click as a feature.

When the button is clicked, you can get the button ID.

Here's an example: Expands your activity activity OnClickListener @ Override Public Zero (see V) {int id = v.getId (); Button B = (button) v; // your code b.setText (); }

Then add this line to the button in XML

Android: onClick = "onClick"

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -