ListView вроде как не подходит — в нём кликабельна вся строка
ListView listView = (ListView) findViewById(R.id.listView);
ListAdapter adapter = new ListAdapter() {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return LayoutInflater.from(getApplicationContext()).inflate(R.layout.list_item, null);
}
@Override public boolean areAllItemsEnabled() {return false;}
@Override public boolean isEnabled(int position) {return false;}
@Override public void registerDataSetObserver(DataSetObserver observer) {}
@Override public void unregisterDataSetObserver(DataSetObserver observer) {}
@Override public int getCount() {return 20;}
@Override public Object getItem(int position) {return null;}
@Override public long getItemId(int position) {return 0;}
@Override public boolean hasStableIds() {return false;}
@Override public int getItemViewType(int position) {return 0;}
@Override public int getViewTypeCount() {return 20;}
@Override public boolean isEmpty() {return false;}
};
listView.setAdapter(adapter);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textView = (TextView) findViewById(R.id.textView);
File sdCard = Environment.getExternalStorageDirectory();
File[] list = sdCard.listFiles();
for (File f : list) {
String fileAbsPath = f.getAbsolutePath().toString();
fileAbsPath = fileAbsPath.replaceAll("[^\\x20-\\x7e]", "");
textView.append(fileAbsPath);
textView.append("\n");
}
textView.append("\n");
for (File f : list) {
String fileAbsPath = f.getAbsolutePath().toString();
textView.append(fileAbsPath);
textView.append("\n");
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)
ArrayList<HashMap<String, String>> arrayList = new ArrayList<HashMap<String, String>>();
List<Camera.Size> supportedPictureSizes = parameters.getSupportedPictureSizes();
parameters.setPictureSize(camSize.width, camSize.height);
camera.setParameters(parameters);