Note that there are some explanatory texts on larger screens.

plurals
  1. POListview is not showing first entry
    primarykey
    data
    text
    <p>I am showing all files from server in listview. </p> <p>Files on server are as follows: binary.txt/erpTestBench/muneem.php/oglPrahova/permitCore/workOrderTestBench/</p> <p>Listview is showing all files except binary.txt file.</p> <p>My listview xml file is as follows:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/path" android:layout_width="fill_parent" android:textSize="12dp" android:layout_height="wrap_content" android:background="#2377ff"/&gt; &lt;ListView android:id="@android:id/list" android:cacheColorHint="#00000000" android:layout_width="fill_parent" android:layout_height="70dp" android:layout_weight="0.85" android:clickable="false" android:textSize="30dp" android:drawSelectorOnTop="false" android:background="#2f3fc8" android:layout_gravity="center" android:dividerHeight="15dp"/&gt; &lt;TextView android:id="@android:id/empty" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="30dp" android:text="No Data" android:layout_weight="0.75" android:background="#2f3fc8"/&gt; &lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:paddingTop="6dp" android:paddingBottom="6dp" android:gravity="center|center_vertical" android:id="@+id/linearLayout" android:background="#346684"&gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView1" android:src="@drawable/power" android:onClick="bt_Quit" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_gravity="center"/&gt; &lt;ImageView android:layout_width="80dp" android:layout_height="fill_parent" android:id="@+id/imageView4" android:src="@drawable/back" android:onClick="back" android:layout_marginLeft="10dp" android:layout_marginRight="10dp"/&gt; &lt;ImageView android:layout_width="71dp" android:layout_height="fill_parent" android:id="@+id/imageView2" android:src="@drawable/home" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:onClick="home"/&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>my java file is as follows:</p> <pre><code>public class serv extends ListActivity { private String m_urlString="XXXXX"; // private String result; private List&lt;String&gt; m_item = null; private List&lt;String&gt; m_path = null; private String m_root="XXXX"; private String m_result; private TextView m_myPath; static private String m_pos; private String m_backposition; private String m_fileURL; int m_downloadedSize = 0; int m_totalSize = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.file_chooser); View v= findViewById(R.id.rowtext); m_myPath = (TextView)findViewById(R.id.path); m_fileURL="http://192.168.1.30/muneem/"; Http_connection f=new Http_connection(); f.execute(""); } class Http_connection extends AsyncTask&lt;String, Void, Void&gt; { private Exception exception; protected Void doInBackground(String... urls) { try { URL url= new URL(m_urlString); HttpURLConnection con=(HttpURLConnection)url.openConnection(); con.setRequestMethod("GET"); con.connect(); int statusCode=con.getResponseCode(); if (statusCode==HttpURLConnection.HTTP_OK){ BufferedReader in= new BufferedReader(new InputStreamReader(con.getInputStream())); String line; m_result=""; while ((line=in.readLine())!=null) { m_result=m_result+"\n"+line; } in.close(); con.disconnect(); runOnUiThread(new Runnable() { @Override public void run() { getDir(m_urlString); } }); } } catch (MalformedURLException e) { // bundle.putString("Error","Problem with URL"); } catch (IOException e) { // bundle.putString("Error","Problem with connection"); } return null; } } private void getDir(String dirPath) { String[] r=m_result.split("/"); m_myPath.setText("Location: " + dirPath); m_item = new ArrayList&lt;String&gt;(); m_path = new ArrayList&lt;String&gt;(); for (int k=0;k&lt;r.length;k++) { if (r[k].contains(".")) { m_item.add(r[k]); } else { m_item.add(r[k]+"/"); } } ArrayAdapter&lt;String&gt; fileList = new ArrayAdapter&lt;String&gt;(serv.this, R.layout.row, m_item); setListAdapter(fileList); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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