Android cursor Error : Make sure the Cursor is initialized correctly before accessing data from it
By : Rameez Hasan
Date : March 29 2020, 07:55 AM
Hope this helps I am going to implement the method to retrieve the record of the strings but when it comes to the execution , it turns Runtime Error as the Log cat stated. Would you please tell us how in correctly initialise the cursor ? , The error message says code :
if(cur!=null){
// Best to manage any non-null cursor as then it will be closed when the
// activity is stopped
startManagingCursor(cur);
// Only if a row was found
if(cur.moveToFirst()) {
Log.d("debug Cursor" , "can be created");
Log.d("KEY_PHOTO_HKID_HEX" , cur.getString(1));
Log.d("KEY_PHOTO_ADDRESS_HEX" , cur.getString(2));
Log.d("KEY_PHOTO_BANK_HEX" , cur.getString(3));
}else{
// Handle no rows returned
}
}else{
Log.d("debug Cursor" , "cannot be created");
}
|
Cursor Error On Android Studio
By : Blitz Techx
Date : March 29 2020, 07:55 AM
it helps some times Well, looked into your code, I found that: Your DatabaseHelper.COL1 is CategId while when onCreate you use CategID as column name
|
Android Studio Suddenly started to display unable to resolve com.android.support...25.0.0 error messages and all of my j
By : safia.rb
Date : March 29 2020, 07:55 AM
I hope this helps you . Open your android SDK manager (from C:\Users\youruseraccount\AppData\Local\Android\sdk) and update following to latest versions in, Tools section section
|
error capture photo and display thumbnail android studio
By : sunchao0427
Date : March 29 2020, 07:55 AM
This might help you The default Android camera application returns a non-null intent only when passing back a thumbnail in the returned Intent. If you pass EXTRA_OUTPUT with a URI to write to, it will return a null intent and the picture is in the URI that you passed in. So since your passing EXTRA_OUTPUT location with your intent it will always retun the null with data and i.e in your case now the photo / captured image is at photoURI path. code :
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == REQUEST_TAKE_PHOTO) {
Uri uri = Uri.fromFile(photoFile); // Here photo file is the file EXTRA_OUTPUT location where you saved the actual camera image
Bitmap bitmap;
try {
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
bitmap = crupAndScale(bitmap, 300); // if you mind scaling
pofileImageView.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
imageView.setImageBitmap(bitmap);
}
}
public static Bitmap crupAndScale (Bitmap source,int scale){
int factor = source.getHeight() <= source.getWidth() ? source.getHeight(): source.getWidth();
int longer = source.getHeight() >= source.getWidth() ? source.getHeight(): source.getWidth();
int x = source.getHeight() >= source.getWidth() ?0:(longer-factor)/2;
int y = source.getHeight() <= source.getWidth() ?0:(longer-factor)/2;
source = Bitmap.createBitmap(source, x, y, factor, factor);
source = Bitmap.createScaledBitmap(source, scale, scale, false);
return source;
}
|
Error display where generate singed APK from android studio
By : d_corson
Date : March 29 2020, 07:55 AM
I hope this helps you . Lint found fatal errors while assembling a release target. , change on build.gradle file inside android {} like below code :
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.xxx"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-
rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
|