Search Results

Search found 5 results on 1 pages for 'androidnoob'.

Page 1/1 | 1 

  • Should I create inner class here or leave as is?

    - by AndroidNoob
    Folks, I have two separate classes. One of them makes http requests/receives response to/from a server and the second one converts received JSON objects into my models (separate classes). I'm thinking it would be an idea to include this class for data converting as an inner class of my first class. Wouldn't my first class be extra big because of it and I need to leave everything as is or this is a good common practice to behave like that?

    Read the article

  • How to define function in a string in Android?

    - by androidNoob
    I have an event handler that I want to be connected to a button through xml. Basically, I want to define it as a string in my xml file, then use the property inspector to select the name of the handler for my button (the "on Click" property). How do I define a call to the function in the string?

    Read the article

  • IO Exception on invoking execute() method of HttpGet class

    - by AndroidNoob
    Why I'm getting IOException in this peace of code? Thanks. HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet("http://www.google.com/"); HttpResponse response; try { response = httpclient.execute(httpget); } catch (ClientProtocolException e) { Toast.makeText(this, "ClientProtocolEx", Toast.LENGTH_LONG).show(); e.printStackTrace(); } catch (IOException e) { Toast.makeText(this, "IOEx", Toast.LENGTH_LONG).show(); e.printStackTrace(); }

    Read the article

  • How to highlight ListView item on touch?

    - by AndroidNoob
    I have a simple ListView and I want each of it items to be highlighted on user's touch. I thought this should happen by default but it isn't. Can you advice? ListView xml: <ListView android:id="@+id/list_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:divider="#206600" android:dividerHeight="2dp" android:smoothScrollbar="true" android:background="#ffffff" > </ListView> And code of my Adapter: private class MyAdapter extends ArrayAdapter<Task> { private LayoutInflater mInflater; public MyAdapter(Context context, int resource, List<Task> list) { super(context, resource, list); mInflater = LayoutInflater.from(context); } @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { v = mInflater.inflate(R.layout.list_item, null); } Task task = taskList.get(position); /* Setup views from your layout using data in Object here */ return v; }

    Read the article

  • Search one element of a list in another list recursively

    - by androidnoob
    I have 2 lists old_name_list = [a-1234, a-1235, a-1236] new_name_list = [(a-1235, a-5321), (a-1236, a-6321), (a-1234, a-4321), ... ] I want to search recursively if the elements in old_name_list exist in new_name_list and returns the associated value with it, for eg. the first element in old_name_list returns a-4321, second element returns a-5321, and so on until old_name_list finishes. I have tried the following and it doesn't work for old_name, new_name in zip(old_name_list, new_name_list): if old_name in new_name[0]: print new_name[1] Is the method I am doing wrong or I have to make some minor changes to it? Thank you in advance.

    Read the article

1