is new to Android I is quite familiar with Objective-C as you can see that I have an array list which That's loaded with a CSV file. I can not seam to straighten it that I was stolen in my "Public Zero Button (see V)" for this string "string ARR: list" why can I read the array list ... "
@ override protected form zero (bundle saved instenstate) {super.ncre (savedinstenstate); setContentView (R.layout.activity_main); SearchButton = (button) Find ViewById (R.id. FindButton); //searchButton.setOnClickListener(this); MainSearchView = (EditText) findViewById (R.id.searchText); spinner1 = ( Piner) Find VVBID (Rd Titel category 1); List of & lt; string & gt; list = new arrelist & lt; string & gt; (); {InputStreamReader csvStreamReader = New InputStreamReader (MainActivity.this.getAssets ( Try "csv"); csvr reader = new csvrder (csvstream reader); log d. ("Test", "csv read"); string [] next line; while ((nextLine = Reader.readNext () = = null) {list.add (next line [0] + next line [1] + next line [2]);}} grip (IOException e) {e.printStackTrace (); }} Public Zero Button Clicked (see V) {Log D. ("Test", "button click"); StrFind2 = Main Search View .getText (). ToString () ToLowerCase (); / * (String ARR: list) {if (Stront Constants (Striffind 2)) {Log D. ("Test", "Easy"); } And {Log D. ("Test", "not easy"); } * /}}
Can anyone guide me?
Prepare your code, I think you are reaching the list within the same activity.
Just declare,
list & lt; String & gt; List; Access
as a class level member field ,
and click on the button (see V)
private list & lt; String & gt; List @ Override Protected Zero (Bundle Saved InstantState) {super.onCreate (SavedInstanceState); SetContentView (R.layout.activity_main); SearchButton = (Button) Find ViewById (R.id.findButton); //searchButton.setOnClickListener(this); MainSearchView = (EditText) findViewById (R.id.searchText); Spinner 1 = (spinner) Find VVBIID (R. Tietel Category 1); List = New Arrestist & lt; String & gt; ();
In addition to this, I am suggesting you to read basic Java programming tutorials about class and variables and scope of methods.
No comments:
Post a Comment