1 package com.intel.realsense.camera;
3 import android.content.Intent;
4 import android.os.Bundle;
5 import android.os.Environment;
6 import androidx.appcompat.app.AppCompatActivity;
7 import android.view.View;
8 import android.widget.AdapterView;
9 import android.widget.ArrayAdapter;
10 import android.widget.ListView;
11 import android.widget.TextView;
20 protected void onCreate(Bundle savedInstanceState) {
21 super.onCreate(savedInstanceState);
22 setContentView(
R.layout.activity_list_view);
23 mFolder = getIntent().getStringExtra(getString(
R.string.browse_folder));
30 TextView
message = findViewById(
R.id.list_view_title);
32 File folder =
new File(getExternalFilesDir(null).getAbsolutePath() + File.separator + mFolder);
33 if(!folder.exists()) {
34 message.setText(
"No RealSense files found");
37 final File[]
files = folder.listFiles();
39 if(files.length == 0) {
40 message.setText(
"No RealSense files found");
44 message.setText(
"Select a file to play from:");
47 final ListView listview = findViewById(
R.id.list_view);
49 for (
int i = 0;
i < files.length; ++
i) {
52 filesNames[
i] = split[split.length - 1];
55 final ArrayAdapter adapter =
new ArrayAdapter<>(
this,
R.layout.files_list_view, filesNames);
56 listview.setAdapter(adapter);
58 listview.setOnItemClickListener(
new AdapterView.OnItemClickListener() {
61 public void onItemClick(AdapterView<?> parent,
final View
view,
62 int position,
long id) {
63 final String item = files[position].getAbsolutePath();
64 Intent intent =
new Intent();
65 intent.putExtra(getString(
R.string.intent_extra_file_path), item);
66 setResult(RESULT_OK, intent);
GLenum GLuint GLenum GLsizei const GLchar * message
uvc_xu_option< int > super
std::vector< uint32_t > split(const std::string &s, char delim)
GLsizei const GLchar *const * path
void onCreate(Bundle savedInstanceState)
::std_msgs::String_< std::allocator< void > > String