Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid: navigation issue in ListView without touch ui on google DTV
    text
    copied!<p>I am working on custom listview My activity is like this</p> <pre><code>public class MainActivity extends Activity { ListView listView = null; int position = 0; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listView = (ListView)findViewById(R.id.list); String[] values = new String[] { "Android List View", "Adapter implementation", "Simple List View In Android", "Create List View Android", "Android Example", "List View Source Code", "List View Array Adapter", "Android Example List View" }; mAdapter = new MyListAdapter(this, R.layout.list_item, new ArrayList&lt;String&gt;(Arrays.asList(values))); listView.setAdapter(mAdapter); listView.setOnItemSelectedListener(mItemListener); } private AdapterView.OnItemSelectedListener mItemListener = new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int position1, long arg3) { mAdapter.setSelection(position1); } @Override public void onNothingSelected(AdapterView&lt;?&gt; arg0) { } }; } </code></pre> <p>And List adapter getView is</p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { String result = mSearchResultList.get(position); ViewHolder holder = null; if (convertView == null) { holder = new ViewHolder(); LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(mResourceId, parent, false); holder.mTextView1 = (TextView)convertView.findViewById(R.id.list_text1); holder.mTextView2 = (TextView)convertView.findViewById(R.id.list_text2); convertView.setTag(holder); }else { holder = (ViewHolder) convertView.getTag(); } if (mSelected == position) { holder.mTextView1.setBackgroundResource(R.drawable.epg_genre_btn_focus); }else { holder.mTextView1.setBackground(null); } holder.mTextView1.setText(result) ; holder.mTextView2.setText(result) ; return convertView; } int mSelected =0; void setSelection(int pos){ mSelected = pos; notifyDataSetChanged(); } </code></pre> <p>I am not working on Touch UI but on google DTV without touch events. I am using DPAD for navigation. Every thing working fine until i am reaching the lastvisible position in the list. When the selected Item is lastvisible position and I press downKey in DPAD the highlighed(bacground item) first scroll one position up then goes down to lastvisible position. Please help me on this i have tried so many permutation and combination but not able to solve the problem</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload