Histogram foto picture smartphone
Very dark picture, in photo editor black remains black
Very bright picture, in photo editor white will white
Dark picture but the chart is not in black color area - dark shades can be lighten in graphics editor


Very bright picture, in photo editor white will white

Dark picture but the chart is not in black color area - dark shades can be lighten in graphics editor

396LW NO topic_id
AD
Další témata ....(Topics)
Android app setup preferences, settings, open, read, write, onStop(), onPause(), getSharedPreferences(), SharedPreferences.Editor getInt(), getBoolean(), getString() , putInt(), putString(), putBoolean() example source code.
import android.content.SharedPreferences;
public class MainClass extends Activity {
public static final String PREFERENCES_NAME = "MyPrefsFile";
String myNewString;
int myNewInt;
Boolean myNewBool;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// read old settings if exist
SharedPreferences settings = getSharedPreferences(PREFERENCES_NAME, 0);
String sDefault = "Hello!";
String sStringFromPrefFile = settings.getString("myString", sDefault); // new text or default Hello!
int nDefaultIndex = 2; //
int nIndexFromPrefFile = settings.getInt("myInt", nDefaultIndex); // 4 or default 2
Boolean bDefault = false;
Boolean bFromPrefFile = settings.getBoolean("silentMode", bDefault); // true or default false
// new settings will saved in onStop or onPause
myNewString = "new text";
myNewInt = 4;
myNewBool = true;
}
@Override
protected void onPause() {
super.onPause();
Toast.makeText(getApplicationContext(), "onPause "
, Toast.LENGTH_SHORT).show();
savePreferences();
}
@Override
protected void onStop() {
super.onStop();
savePreferences();
}
/**save settings*/
public void savePreferences(){
try {
SharedPreferences settings = getSharedPreferences(PREFERENCES_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("myString", myNewString);
editor.putInt("nMyInt", myNewInt);
editor.putBoolean("silentMode", myNewBool); //
editor.commit();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
FLAG_KEEP_SCREEN_ON saving energy. Protects the battery if a user closing applications using the Return button on device. The device will returned to user screen mode settings.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
//..........
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
R.string.app_name to String example.
MyActivity.java
res/values/string.xml
MyActivity.java
Resources res = getResources();
String sText = res.getString(R.string.app_name);
res/values/string.xml
<resources>
<string name="app_name">My app name</string>
</resources>
// image from res/drawable
int resID = getResources().getIdentifier("my_image",
"drawable", getPackageName());
// view
int resID = getResources().getIdentifier("my_resource",
"id", getPackageName());
// string
int resID = getResources().getIdentifier("my_string",
"string", getPackageName());
If You create new xml file with prefix _ , for example _style.xml and You to clean project (Project->Clean), than package in folder project\gen will deleted with R.java class and new R.java not be created.
For to solving this problem You have to rename file without prefix _ as style.xml or name what You need and rebuild project.
If some ID cannot be resolved or is not a field get error occurence
You have to delete import android.R; in Activity.class if was inserted,
when this error is displayed.
For to solving this problem You have to rename file without prefix _ as style.xml or name what You need and rebuild project.
If some ID cannot be resolved or is not a field get error occurence
You have to delete import android.R; in Activity.class if was inserted,
when this error is displayed.
Editace: 2017-08-05 13:45:38
Počet článků v kategorii: 396
Url:histogram-foto-picture-smartphone