Tag Archives: xml

874 views

Difference between “@+id/” and “@id/” in Android

Difference between “@+id/” and “@id/” in Android android:id=”@+id/xxx” unique identifier of view @id/ a reference to the unique identifier <TextView android:id="@+id/first_element_id" ……… /> <TextView android:id="@+id/second_element_id" android:layout_below="@id/first_element_id" ………. />

Posted in Android Examples Code | Tagged | Comments Off on Difference between “@+id/” and “@id/” in Android
3,788 views

xml string with html tags Android

// in strings.xml <string name="myStringWithTags"><![CDATA[<b>some text..</b> other tags …]]></string> <string name="myStringWithPattern"><![CDATA[<b>%s</b> other tags …]]></string> // in Activity.class String sHtmlText = this.getApplicationContext().getString(R.string.myStringTags); sHtmlText = this.getApplicationContext().getString(R.string.myStringWithPattern,"replace %s with this text");

Posted in Android Examples Code | Tagged , , , | Comments Off on xml string with html tags Android
6,074 views

R cannot be resolved to a variable

Check your xml files in Eclipse Graphical Editor and fix problems. Check project setup, right click on project, select properties, Java build path and select correct Android version etc. Right click on project, Android Tools, Fix Project Properties Menu Eclipse … Continue reading

Posted in Bugs, warnings, errors, Eclipse | Tagged , | Comments Off on R cannot be resolved to a variable
2,220 views

On orientation changed view button textview not visible Android

Try add to AndroidManifest.xml configChanges for your Activity android:configChanges=”keyboardHidden|orientation|screenSize” <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation|screenSize" >

Posted in Android Examples Code | Tagged , | Comments Off on On orientation changed view button textview not visible Android
4,077 views

Call requires API level xx current min is xx android

Call requires API level 16 (current min is 4): android Change The SDK version in AndroidManifest.xml to higher <uses-sdk android:minSdkVersion="4" /> // <uses-sdk android:minSdkVersion="8" />

Posted in Android Examples Code | Tagged , , | Comments Off on Call requires API level xx current min is xx android
4,088 views

Not request focus EditText if startup Android

Not request focus EditText if startup Android – hide keyboard if startup. Remove: from EditText Create a LinearLayout and set the: attributes android:focusable=”true” android:focusableInTouchMode=”true” <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="true" android:focusableInTouchMode="true" android:orientation="vertical" > </LinearLayout>

Posted in Android Examples Code | Tagged , , | Comments Off on Not request focus EditText if startup Android
10,662 views

How to Scroll large image in ImageView Android Example

main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:gravity="top" android:layout_width="fill_parent" android:layout_height="fill_parent" >   <ScrollView android:id="@+id/scrollView1" android:layout_width="fill_parent" android:layout_height="wrap_content" >   <HorizontalScrollView android:id="@+id/horizontalScrollView1" android:layout_width="match_parent" android:layout_height="wrap_content" >     <LinearLayout android:gravity="top" android:layout_width="fill_parent" android:layout_height="wrap_content" >   <ImageView android:id="@+id/imageViewObrazekGeometrie" android:layout_width="360dp" android:layout_height="777dp" android:src="@drawable/geometrie_vzorecky" />   </LinearLayout> </HorizontalScrollView> </ScrollView>   </LinearLayout>

Posted in Android Examples Code, Bitmap, drawing | Tagged , | Comments Off on How to Scroll large image in ImageView Android Example
3,259 views

Include xml into another xml Android Example

How include layout defined in other xml file into another xml file example: res/layout/my_layout.xml into main.xml <include layout="@layout/my_layout" android:id="@+id/idMyLayout" />

Posted in Android Examples Code | Tagged , | Comments Off on Include xml into another xml Android Example
9,273 views

Eclipse Xml Incorrect Line Endings

Incorrect line ending: found carriage return (\r) without corresponding newline (\n) Move mouse cursor on error text and press Ctrl+1 Select Fix line endings and press Enter See image below:

Posted in Android Examples Code, Bugs, warnings, errors, Eclipse | Tagged , | Comments Off on Eclipse Xml Incorrect Line Endings
1,798 views

Android Xml Tags Samples

<account-authenticator<action<activity<activity-alias<alpha<android<application<appwidget-provider<attr<AutoCompleteTextView<Button<category<color<com<ContactsDataKind<ContactsSource<corners<cycleInterpolator<declare-styleable<device-admin<dimen<drawable<EditText<EditTextPreference<enum<force-lock<FrameLayout<Gallery<gradient<gridLayoutAnimation<GridView<GridView<group<CheckBox<CheckBoxPreference<Chronometer<ImageButton<ImageSwitcher<ImageView<ImageView<input-method<instrumentation<intent<intent-filter<item<Key<Keyboard<layer-list<layoutAnimation<limit-password<LinearLayout<ListPreference<ListView<manifest<menu<meta-data<MultiAutoCompleteTextView<padding<path<pathelement<plurals<PreferenceCategory<PreferenceScreen<ProgressBar<property<provider<QuickContactBadge<RadioButton<RadioGroup<RatingBar<receiver<recognition-service<RelativeLayout<requestFocus<reset-password<resources<rotate<Row<scale<ScrollView<SDK<searchable<SeekBar<selector<service<set<setup<shape<size<skip<solid<Spinner<string<string-array<stroke<style<SurfaceView<sync-adapter<TableLayout<TableRow<taskdef<tech<tech-list<TextSwitcher<TextView<TextView<TimePicker<ToggleButton<translate<uses-feature<uses-library<uses-permission<uses-policies<uses-sdk<VideoView<View<ViewFlipper<wallpaper<watch-login<WebView<wipe-data

Posted in Android Examples Code | Tagged , | Comments Off on Android Xml Tags Samples