• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Please help!

Oh sorry for that.

Okay I will explain it.

Our apps is called "VN MAKER".

A development apps that let the user create a Visual Novel.

The thing is we don't know what to do in creating new project and we are thinking

of creating new xml file as a body of the "New Project" I am talking.

And then when the user chooses the "New Project" a new XML file will be created as

the body of the "New Project" of "VN Maker"

And my problem is, I don't have an idea how can I put it in codes or s it really possible to creat that function.
 
Upvote 0
Yup. I'll give ya some code for a head start

Code:
 else if (item.getTitle().toString().equalsIgnoreCase("Pick an image")) {
            Intent i = new Intent(Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
      
                startActivityForResult(i, IMAGE);
            Toast.makeText(this, "your Screenshots are here", Toast.LENGTH_LONG).show();
                    }
        return true;
        
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);

      if(resultCode==RESULT_OK && requestCode==IMAGE){
       Uri selectedImage=data.getData();
       String path=getPath(selectedImage);

       Bitmap bitmapImage=BitmapFactory.decodeFile(path);
//this part puts it on a imageview
       ImageView image=(ImageView)findViewById(R.id.image);
       image.setImageBitmap(bitmapImage);

      }
    }

    public String getPath(Uri uri){
      String[] filePathColumn={MediaStore.Images.Media.DATA};

      Cursor cursor=getContentResolver().query(uri, filePathColumn, null, null, null);
      cursor.moveToFirst();
      int columnIndex=cursor.getColumnIndex(filePathColumn[0]);

      return cursor.getString(columnIndex);
    }
I use that to let people use their gallery to pick an image off their sdcard and set it to an imageview.

play around with it a little and you can get them them to pull it out of a drawable folder.

you got lucky I had Eclipse open ;)
 
  • Like
Reactions: c0dered22
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones