ImageView not Clickable in DialogFragment - java

I have an ImageView for which I wanted to implement the onClickListener. But when I click on the image, nothing happens. Event the Logcat does not show any errors.
Something is happening with the clickability attribute.
My XML code:
<ImageView
android:id="#+id/img2"
android:layout_width="104dp"
android:layout_height="126dp"
android:layout_weight="1"
android:padding="8dp"
android:scaleType="centerCrop"
android:clickable="true"
android:src="#drawable/ic_person_black_24dp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="-3dp"
tools:layout_editor_absoluteY="14dp"
android:focusable="true" />
Code in Fragment:
public class DialogFrag extends DialogFragment {
private ImageView img2;
private static final int IMAGE_PICK_CODE = 1000;
private final int CODE_MULTIPLE_IMG_GALLERY = 2;
#RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
#NonNull
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_layout, container, false);
img2 = (ImageView) view.findViewById(R.id.img2);
img2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, IMAGE_PICK_CODE);
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, #Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
int CODE_IMG_GALLERY = 1;
if (requestCode == CODE_IMG_GALLERY && resultCode == RESULT_OK) {
Uri imageUri = data.getData();
if(imageUri!=null){
img2.setImageURI(imageUri);
}
}
if (requestCode == CODE_IMG_GALLERY && resultCode == RESULT_OK) {
Uri imageUri = data.getData();
if(imageUri!=null){
img2.setImageURI(imageUri);
}
}
}
#RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
return builder
.setTitle("Заполните анкету")
.setView(R.layout.dialog_layout)
.setPositiveButton("OK", null)
.setNegativeButton("Отмена", null)
.create();
}
}
Where is my mistake?
Help please)

Please override the onViewCreated() and use the view object
kotlin code:
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
img2 = view.findViewById(R.id.img2);
// Implement onclicklistener
}
This should be of any help I guess.

Related

opening camera and gallery from recycler view adapter using OnActivityResult

I created a part in my adapter that is responsible for editing profile picture , I am using a library called android image cropper , which need on activity result to run , but since I am in adapter class, It does not let me use Activity methods. I searched but I could not understand the codes, because most of the use activity and I use fragment. this is my adapter class(only a part of it):
holder.btn_edit.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
final LayoutInflater inflater=LayoutInflater.from(context);
View add_view=inflater.inflate(R.layout.dialog_addcontacts,null);
AlertDialog alertDialog=new AlertDialog.Builder(context).create();
alertDialog.setView(add_view);
final TextInputEditText edt_name=add_view.findViewById(R.id.edt_name);
final TextInputEditText edt_phonenumber=add_view.findViewById(R.id.edt_number);
byte[] contactimage=phonebookModel.getImage();
Bitmap bitmap= BitmapFactory.decodeByteArray(contactimage,0,contactimage.length);
final CircleImageView image_profile=add_view.findViewById(R.id.profile_image);
Button btn_add=add_view.findViewById(R.id.btn_add);
btn_add.setText("change");
edt_name.setText(phonebookModel.getName());
edt_phonenumber.setText(phonebookModel.getPhonenumber());
image_profile.setImageBitmap(bitmap);
image_profile.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
CropImage.activity()
.setGuidelines(CropImageView.Guidelines.ON)
.setCropShape(CropImageView.CropShape.OVAL)
.setMaxCropResultSize(2500,2500)
.setAspectRatio(1,1)
.setScaleType(CropImageView.ScaleType.CENTER)
.start(getContext(),ContactsFragment.this);
}
}
});
private byte[] imagetobyte(CircleImageView image){
Bitmap bitmap=((BitmapDrawable) image.getDrawable()).getBitmap();
ByteArrayOutputStream stream=new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG,50,stream);
byte[] bytearray=stream.toByteArray();
return bytearray;
}
and this is my fragment:
public class ContactsFragment extends Fragment {
RecyclerView recyclerView;
FloatingActionButton floatingActionButton;
PhoneBookDB phoneBookDB;
CircleImageView imagebutton;
#Nullable
#Override
public View onCreateView(#NonNull LayoutInflater inflater, #Nullable ViewGroup container, #Nullable Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.contactsfragment,container,false);
phoneBookDB =new PhoneBookDB(getContext());
//recycler-contacts
recyclerView= view.findViewById(R.id.recycler_contacts);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext(),RecyclerView.VERTICAL,false));
List<PhonebookModel> models=phoneBookDB.getalldata();
Contactsadapter adapter=new Contactsadapter(models,getContext());
recyclerView.setAdapter(adapter);
//add-contacts
floatingActionButton=view.findViewById(R.id.btn_add_contacts);
floatingActionButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
showdialog();
}
});
return view;
}
public void showdialog() {
final LayoutInflater inflater=LayoutInflater.from(getContext());
View add_view=inflater.inflate(R.layout.dialog_addcontacts,null);
final AlertDialog alertDialog=new AlertDialog.Builder(getContext()).create();
alertDialog.setView(add_view);
final TextInputEditText edt_name=add_view.findViewById(R.id.edt_name);
final TextInputEditText edt_phonenumber=add_view.findViewById(R.id.edt_number);
imagebutton=add_view.findViewById(R.id.profile_image);
imagebutton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
CropImage.activity()
.setGuidelines(CropImageView.Guidelines.ON)
.setCropShape(CropImageView.CropShape.OVAL)
.setMaxCropResultSize(2500,2500)
.setAspectRatio(1,1)
.setScaleType(CropImageView.ScaleType.CENTER)
.start(getContext(),ContactsFragment.this);
}
});
Button btn_add=add_view.findViewById(R.id.btn_add);
Button btn_cancel=add_view.findViewById(R.id.btn_cancel);
btn_add.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
if (!edt_name.getText().toString().isEmpty()&&!edt_phonenumber.getText().toString().isEmpty()) {
long i= phoneBookDB.insertdata(edt_name.getText().toString(), edt_phonenumber.getText().toString(),imagetobyte(imagebutton));
Toast.makeText(getContext(), i+"", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getContext(), MainActivity.class));
}else {
Toast.makeText(getContext(), "لطفا تمامی فیلد های خواسته شده را پر کنید", Toast.LENGTH_SHORT).show();
}
}
});
btn_cancel.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
alertDialog.dismiss();
}
});
alertDialog.show();
}
#Override
public void onActivityResult(int requestCode, int resultCode, #Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
CropImage.ActivityResult result = CropImage.getActivityResult(data);
if (resultCode == RESULT_OK) {
Uri resultUri = result.getUri();
try {
InputStream inputStream= getActivity().getContentResolver().openInputStream(resultUri);
imagebutton.setImageBitmap(BitmapFactory.decodeStream(inputStream));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
Exception error = result.getError();
}
}
}
private byte[] imagetobyte(CircleImageView image){
Bitmap bitmap=((BitmapDrawable) image.getDrawable()).getBitmap();
ByteArrayOutputStream stream=new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG,50,stream);
byte[] bytearray=stream.toByteArray();
return bytearray;
}
From my understanding so far by reading your question, I assume that you would like to start the library activity using CropImage.activity()... and get the crop result with onActivityResult inside Fragment.
In order to get the crop result with onActivityResult inside Fragment, I assume you need to start the library activity using Fragment#startActivityForResult.
To call Fragment#startActivityForResult when adapter item is clicked, I can think of two ways:
Pass the instance of fragment to the adapter class and start activity from fragment when the item is clicked.
Define and pass a on listener from fragment to adapter to make it possible to handle adapter's on click event
Maybe the issue and the comment below helps:
https://github.com/ArthurHub/Android-Image-Cropper/issues/762#issuecomment-648859151
(Maybe it would be helpful if you could clarify both what you know or do, what you have tried, and what you do not know about so it makes it easier for others to understand your situation and understanding level. For example, you could give us some other codes or logics that you have already tried to let others understand your situation clearer. )

My EditText's setText didn't have compiler error, but the app force closed

I want to make my EditText get something from my firebase database, but it can't do setText method
I read many things from stackoverflow, but can't get the problem of my app
Here is the class code:
public class TabFragment4 extends Fragment {
Uri filePath;
private static final int PICK_IMAGE = 100;
#Nullable
#Override
public View onCreateView(#Nullable LayoutInflater inflater, #Nullable ViewGroup container, #Nullable Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment4_layout, container, false);
Bundle b1 = this.getArguments();
final String name = b1.getString("name");
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("user").child(name);
myRef.addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(DataSnapshot dataSnapshot) {
String na = dataSnapshot.child("nama").getValue(String.class);
String ma = dataSnapshot.child("hp").getValue().toString();
EditText edit1 = (EditText) view.findViewById(R.id.edit1);
EditText edit2 = (EditText) view.findViewById(R.id.edit2);
edit1.setText(na);
edit2.setText("Test");
}
#Override
public void onCancelled(DatabaseError error) {
}
});
Button btn = (Button) view.findViewById(R.id.btng1);
ImageView ipv = (ImageView) view.findViewById(R.id.ivp);
new DownloadImageTask(ipv)
.execute("https://firebasestorage.googleapis.com/v0/b/tugasakhir-6571b.appspot.com/o/images%2F"+name+"?alt=media");
ipv.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(i, PICK_IMAGE);
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
ImageView imgProf = (ImageView) this.getView().findViewById(R.id.ivp);
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK && requestCode == PICK_IMAGE){
filePath = data.getData();
imgProf.setImageURI(filePath);
}
}
}
I can't do setText with String variable, even with new String directly

Not getting Contact Number in Fragment

I created below class but numbers is coming null. The same code is working fine with activity. I have made changes in context of Fragment. What else is creating problem in the code.
public class TestFrag extends Fragment {
private static final String[] phoneProjection = new String[]{ContactsContract.CommonDataKinds.Phone.DATA};
#Nullable
#Override
public View onCreateView(LayoutInflater inflater, #Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.testfrag, container, false);
TextView textView = (TextView) view.findViewById(R.id.clickme);
EditText editText = (EditText) view.findViewById(R.id.contact);
textView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
getActivity().startActivityForResult(intent, 1);
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case (1):
//ContentResolver cr = getContentResolver();
Uri contactData = data.getData();
Cursor c = getActivity().getContentResolver().query(contactData, phoneProjection, null, null, null);
if (c.moveToFirst()) {
String numbers = c.getString(0);
Log.e("Hi", numbers);
}
break;
}
}
}
you are calling getActivity().startActivityForResult(intent, 1); it's response will be handled in activity's onActivityResult() method you should call startActivityForResult(intent, 1); which is fragment's method and will call the fragments onActivityResult().
you can check this link too

Why doesn't my textview display anything?

im currently doing a app that has a barcode scanner. currently when i scanned the barcode it is suppose to display the format of the barcode and the contents also. but currently it doesnt display the format and contents after scanning.
here is the code
public class ThreeFragment extends Fragment{
public ThreeFragment() {
// Required empty public constructor
}
Button scan_btn;
EditText Edit_current;
TextView formatTxt, contentTxt;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_one, container, false);
scan_btn = (Button) view.findViewById(R.id.scan_button);
final Activity activity = getActivity();
scan_btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.setDesiredBarcodeFormats(IntentIntegrator.PRODUCT_CODE_TYPES);
integrator.setPrompt("Scan");
integrator.setCameraId(0);
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result.getContents() != null) {
if (result.getContents() != null){
String scanContent = result.getContents();
String scanFormat = result.getFormatName();
// display it on screen
formatTxt.setText("FORMAT: " + scanFormat);
contentTxt.setText("CONTENT: " + scanContent);
} else {
Toast toast = Toast.makeText(getContext(),"No scan data received!", Toast.LENGTH_SHORT);
toast.show();
}
}
}
}
my xml
<RelativeLayout 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" >
<Button android:id="#+id/scan_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="#string/scan" />
<TextView
android:id="#+id/scanFormat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:layout_centerHorizontal="true"
android:layout_below="#id/scan_button" />
<TextView
android:id="#+id/scanContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:layout_centerHorizontal="true"
android:layout_below="#id/scanFormat" />
</RelativeLayout>
i have edit the code to this
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_one, container, false);
scan_btn = (Button) view.findViewById(R.id.scan_button);
formatTxt = (TextView) view.findViewById(R.id.scanFormat);
contentTxt = (TextView) view.findViewById(R.id.scanContent);
final Activity activity = getActivity();
scan_btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.setDesiredBarcodeFormats(IntentIntegrator.PRODUCT_CODE_TYPES);
integrator.setPrompt("Scan");
integrator.setCameraId(0);
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result.getContents() != null) {
if (result.getContents() == null){
Toast toast = Toast.makeText(getContext(),"No scan data received!", Toast.LENGTH_SHORT);
toast.show();
}else{
String scanContent = result.getContents();
String scanFormat = result.getFormatName();
// display it on screen
formatTxt.setText("FORMAT: " + scanFormat);
contentTxt.setText("CONTENT: " + scanContent);
}
}
}}
still cant display the format and contents
Initialize your formatTxt & contentTxt in your onCreateView() method!
Scan is alright, it just gives NPE because of not initializing TextView
scan_btn = (Button) view.findViewById(R.id.scan_button);
formatTxt = (TextView) view.findViewById(R.id.scanFormat);
contentTxt = (TextView) view.findViewById(R.id.scanContent);
and in your activityResult
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result.getContents() != null) {
String scanContent = result.getContents();
String scanFormat = result.getFormatName();
// display it on screen
formatTxt.setText("FORMAT: " + scanFormat);
contentTxt.setText("CONTENT: " + scanContent);
}
}
update: that's how it look in your code.
public class ThreeFragment extends Fragment{
public ThreeFragment() {
// Required empty public constructor
}
Button scan_btn;
EditText Edit_current;
TextView formatTxt, contentTxt;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_one, container, false);
scan_btn = (Button) view.findViewById(R.id.scan_button);
//initialize the textViews
formatTxt = (TextView) view.findViewById(R.id.scanFormat);
contentTxt = (TextView) view.findViewById(R.id.scanContent);
final Activity activity = getActivity();
scan_btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.setDesiredBarcodeFormats(IntentIntegrator.PRODUCT_CODE_TYPES);
integrator.setPrompt("Scan");
integrator.setCameraId(0);
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result.getContents() != null) {
String scanContent = result.getContents();
String scanFormat = result.getFormatName();
// display it on screen
formatTxt.setText("FORMAT: " + scanFormat);
contentTxt.setText("CONTENT: " + scanContent);
}else {
Toast toast = Toast.makeText(getContext(),"No scan data received!", Toast.LENGTH_SHORT);
toast.show();
}
}
}
package com.sp.ez_mart_xy;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
private TabLayout tabLayout;
private ViewPager viewPager;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewPager = (ViewPager) findViewById(R.id.viewpager);
setupViewPager(viewPager);
tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
}
private void setupViewPager(ViewPager viewPager) {
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new OneFragment(), "NAVIGATION");
adapter.addFragment(new TwoFragment(), "HOME");
adapter.addFragment(new ThreeFragment(), "PRICE-CHECKER");
viewPager.setAdapter(adapter);
}
class ViewPagerAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
public ViewPagerAdapter(FragmentManager manager) {
super(manager);
}
#Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
#Override
public int getCount() {
return mFragmentList.size();
}
public void addFragment(Fragment fragment, String title) {
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
#Override
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
}
}
this is my mainactivty but i dont see any errors
There are at least two issues with your code:
You have the same if statement twice:
if (result.getContents() != null) {
if (result.getContents() != null){
The outer one does not have an else, so you will not know when the condition fails even though the inner one does have an else.
formatTxt is not initialized. You need to add a call to findViewById() somewhere in onCreateView() to initialize it.

How to crop option set while choosing Image from gallery in Fragment

In my app, I have Written code for getting the Image from gallery and cropped and set into the Image View but the image is not set. If i didnt use crop option coding means its working fine.
I dont know how to use crop option in Fragment.
Here my code:
ProfileFragment:
public class ProfileFragment extends Fragment {
private ImageView imageView;
private static final int SELECT_PHOTO = 1;
private Uri mSelectedImageUri = null;
Button browseProfilePic;
#Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
setHasOptionsMenu(true);//For option menu
View view = inflater.inflate(R.layout.fragment_layout_profilepic, container,
false);
imageView = (ImageView)view.findViewById(R.id.profile_image);
browseProfilePic = (Button) view.findViewById(R.id.btn_pick);
browseProfilePic.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent intent = new Intent(
Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
// Show only images, no videos or anything else
intent.setType("image/*");
//Crop option
intent.putExtra("crop", "true");
intent.putExtra("aspectX",0);
intent.putExtra("aspectY",0);
intent.putExtra("outputX",200);
intent.putExtra("outputY",150);
//intent.setAction(Intent.ACTION_GET_CONTENT);
intent.putExtra("return-data",true);
// Always show the chooser (if there are multiple options available)
startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_PHOTO);
}
});
return view;
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d("Request Code:", String.valueOf(requestCode));
Log.d("Result Code:", String.valueOf(resultCode));
Log.d("Data:",String.valueOf(data));
if (requestCode == SELECT_PHOTO && data != null) {
mSelectedImageUri = data.getData();
Log.d("Uri:", String.valueOf(mSelectedImageUri));
//User had pick an image.
Cursor cursor = getActivity().getContentResolver().query(mSelectedImageUri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null);
cursor.moveToFirst();
//Link to the image
final String imageFilePath = cursor.getString(0);
cursor.close();
File file = new File(imageFilePath);
Log.d("File:", String.valueOf(file));
if (file != null) {
Bitmap bMap = BitmapFactory.decodeFile(String.valueOf(file));
imageView.setImageBitmap(bMap);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
}
Please anyone help to fix!
Thanks in advance..

Categories