Skip to main content

Posts

Showing posts from 2011

save picture in Android

Uri uri = activity.getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values); But, when I insert a new image entry instead of an audio entry I get no error! (import android.provider.MediaStore.Images.Media; instead of android.provider.MediaStore.Audio.Media; would work, but I need to insert a audio file)

android textsize sp, px, dp

android:textSize Since:  API Level Size of the text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp). Must be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). This may also be a reference to a resource (in the form " @[ package :] type : name ") or theme attribute (in the form " ?[ package :][ type :] name ") containing a value of this type. This corresponds to the global attribute resource symbol  textSize .

change icon when select tab in android

//TabActivity.onCreate() TabHost tabHost = getTabHost(); TabHost.TabSpec spec; Intent intent; intent = new Intent().setClass(this, YourClass.class); spec = tabHost.newTabSpec("tab_name").setIndicator("Tab Text", getResources().getDrawable(R.drawable.ic_tab_dialer)) .setContent(intent); tabHost.addTab(spec); Then, you need to add ic_tab_dialer.xml to res/drawable/ directory with this content: