Android array result shows in multiple textview -


I am trying to show the result that I got from my array function which has a lot of results in the text view

For example, if the result is 1, 3, 5, 7, 9, then each result will be displayed in each text view.

How to do this?

  // This function is used to determine how many pages can be flipped, I used Visual Flapper in this case. RangeValue user input depends on the public int binaryRangePage (int rangeValue) {int flipperPage = 1; While (range value> = 2) {rangeValue = rangeValue / 2; FlipperPage ++; } Return flip page; } Total page = binaryrange page (border mode); // Initialization range 2 dimensional table binerytables = new int [range mode + 1] [total page + 1]; Int n; Int i; Int k; For looping range for // (i = 1; i & lt; = rangeMode; i ++) {n = i; Flippage = 1; // While looping for each page in the View Flipper (n> gt; 0) {Balance = N% 2; BinaryTable [I] [flippages] = Balance; N = (int) monastery. Floor (N / 2); System.out.println ("Remnant [" + I + "] [" + Flipppage + "]:" + left); FlipperPage ++; } // If the current page is less than total page value, then the remaining page will be filled with 0 (flipperpage & lt; = totalpage) {// missing for the remaining page (c = 0) (k = flipperPage ; K & lt; = Kulpage; K ++) {Binary table [ii] [flippage] = 0; System.out.println ("Remnant [" + I + "] [" + Flipppage + "]: 0"); FlipperPage ++; }}   

I am trying to show the value of the range which is the remaining 1. For example, the limit is 10, there are 4 pages that can be flipped. In page 1, the value is 1, 3, 5, 7 and 9. These values ​​will be shown in text visual

You need to create your text visuals dynamically. The way.

  Linear layout layout = (linear layout) Find VVBID (RID.LineLayout1); For (int i = 0; i & lt; = array.length; i ++) {textview tv = new textview (getApplicationContext ()); Tv.setText (array [i]); Layout.addView (TV); }   

But since you say that your textview has been cured, you need to do something that is not really "appropriate for programming" but here you can go:

  if (array [0]! = null) {textView1.setText (array [0]); } And {textView1.setVisibility (see GONE); } If (array [1]! = Null) {textView2.setText (array [1]); } And {textView2.setVisibility (see GONE); }. . If (array [9]! = Null) {textView10.setText (array [9]); } And {textView10.setVisibility (see GONE); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -