Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Linkify TextView clickable phone number url adress

android:autoLink="all"

 <!-- text1 automatically linkifies things like URLs and phone numbers. -->
  <TextView
            android:id="@+id/text1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:autoLink="all"
            android:text="@string/link_text_auto"
            />

396LW NO topic_id




AD

Další témata ....(Topics)


305

Eclipse Escape text when pasting into a string literal | eclipse-escape-text-when-pasting-into-a-string-literal



Window>Preference>Java>Editor>Typing and check the "Escape text when pasting into a string literal".
217

How to save the state of Activity - Android | how-to-save-the-state-of-activity-android


onSaveInstanceState, onRestoreInstanceState , save preferences

int mCurrentPhotoIndex = 0;
   @Override
    protected void onSaveInstanceState(Bundle outState) {
        outState.putInt("photo_index", mCurrentPhotoIndex);
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        mCurrentPhotoIndex = savedInstanceState.getInt("photo_index");
        super.onRestoreInstanceState(savedInstanceState);
    }

// or save preferences for new start of Activity in onStop
//onCreate or onResume or onStart etc.
public void loadPreferences() {
		SharedPreferences settings = getSharedPreferences(F.PREFERENCES_NAME, 0);
		mCurrentPhotoIndex = settings.getInt("mCurrentPhotoIndex",mCurrentPhotoIndex);
	// String_sOtazka = settings.getString("_sOtazka", _sOtazka);


}
// onStop
public void savePreferences() {
		SharedPreferences settings = getSharedPreferences(PREFERENCES_NAME, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putInt("mCurrentPhotoIndex", mCurrentPhotoIndex);
                // String, boolean, float ...
		// editor.putString("mButton1", mButton1.getText().toString());

		editor.commit();

}

221

android - OnClickListener must override a superclass method | android-onclicklistener-must-override-a-superclass-method


The method onClick(DialogInterface, int) of type new DialogInterface.OnClickListener(){} must override a superclass method.

Try this:
Right click on project
Select Properties
In open dialogue select Java compiler
Set Enable project specific settings
Set Compiler compliance level to 1.6

android/project-properties-eclipse.png

android/java-compiler-settings-eclipse.png