Note that there are some explanatory texts on larger screens.

plurals
  1. POSorting Images
    text
    copied!<p>lets start from begining I need images to be sorted by folders. like drawable/Photos, drawable/items, drawable/photos. and put each folder to the registry or at least find way to get them out of there. all I want is something close to php like "../img/photos/photo0.jpg". is there way to do something like this. and folder with Imges must contain in apk file.</p> <p>possible solutions is make link in the R file but I didn't find how to do it, other solution is find comand with logic like I will show you here :</p> <pre><code>ImageView img = (ImageView)CloningTable.findViewById(R.id.img); String ImgPath = "com.test.test/img/img0.jpg"; img.setImageDrawable(Drawable.createFromPath(ImgPath)); </code></pre> <p>OR</p> <pre><code>ImageView img= (ImageView)CloningTable.findViewById(R.id.img); String ImgPath = "com.test.test/img/img0.jpg"; img.setImageResource(ImgPath); </code></pre> <p>please say me the best way to handle it. AND specify if it contain path how I can know path the file lies in.</p> <pre><code> File ImgFile = new File("test/test.jpg"); TextView testtext= (TextView)CloningTable.findViewById(R.id.testtext); if (ImgFile.exists()) { test.setImageBitmap(BitmapFactory.decodeFile(ImgFile.getPath())); testtext.setText("asdasuidjasdk"); } </code></pre> <p>can any one say Why programm can't find file and file exist 100% = /?</p> <p>filepath: Project> assets/test/test.jpg</p> <p>found solution <a href="https://stackoverflow.com/questions/3691295/android-show-image-by-path">Android Show image by path</a></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