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.

Android button text alignment left right - sample



android:gravity="left|center_vertical" or android:gravity="right|center_vertical"
               
<Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="left|center_vertical"
                    android:paddingLeft="20dp"
                    android:text="My Button"
                     />


397LW NO topic_id



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


301

R cannot be resolved to a variable | r-cannot-be-resolved-to-a-variable


Check your xml files in Eclipse Graphical Editor and fix problems.

r-cannot-be-resolved-android

Check project setup, right click on project, select properties, Java build path and
select correct Android version etc.
order-and-export-eclipse-android-project

Right click on project, Android Tools, Fix Project Properties

Menu Eclipse select Project ->Clean.
14

SQLite explorer download | sqlite-explorer-download


Best of SQLite explorer and admin download for SQLite 2.x and SQLite 3.x in separated folders.

Download Explorers SQLite 2.x and SQLite 3.x in separated folders
46

How get versionName package name versionCode minSdkVersion Android example | how-get-versionname-package-name-versioncode-android-example


How get application version, sdk version, package name defined in the AndroidManifest file programmically Android sample.

MainClass.java onCreate()

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
			setContentView(R.layout.main);

         // in onCreate
         PackageInfo pinfo = this.getPackageManager().getPackageInfo(getPackageName(), 0);
         String sVersionCode = pinfo.versionCode; // 1
         String sVersionName = pinfo.versionName; // 1.0
         String sPackName = getPackageName(); // cz.okhelp.my_app
         int nSdkVersion = Integer.parseInt(Build.VERSION.SDK); // 7
         int nSdkVers = Build.VERSION.SDK_INT; // 7

       }



AndroidManifes.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="//schemas.android.com/apk/res/android"
      package="cz.okhelp.my_app"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Add_view_to_tableActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>

393

Android 4.4 Lenovo A6000 black screen | android-4-4-lenovo-a6000-black-screen


Try reboot device.
Start device with start button on side of phone.
Screen will go to light black color.
Long press Start button for menu:
Power off
Reboot
Airplane mode

Reboot item is in same level like Start button.
Click on the screen - (Hear a click)
Now find OK button , it is under Reboot item on right side of screen.
Press OK (Hear a click)
Wait a moment.
If device to do nothing , try short press Start button (sreen will black)
and again to press Start button. If screen go to light black color,
try again find Reboot item as written above.
339

Cursor managedQuery Deprecated | cursor-managedquery-deprecated


Try this code with CursorLoader:

Uri uri = getIntent().getData();

// DEPRECATED
Cursor cursor = managedQuery(uri, null, null, null, null);

// WORKING - loadInBackground() preventing freezing of app
 Cursor cursor  = new CursorLoader(getApplicationContext(),uri, null, null, null, null).loadInBackground();
        


Editace Jana Žákovská : 2011-10-30 11:25:20
Počet článků v kategorii: 397
Url:android-button-textalignment
Share
Share
Tweet