Android Google Maps Night Mode
If you want save battery, select "Satelite map" from map menu and reduce the brightness of the display.
396LW NO topic_id
AD
Další témata ....(Topics)
ScrollTo(), getTop(), getBottom(), getLeft(), getRight(), ScrollView, LinearLayout Android Java xml example.
How get position of a View.
MainClass.java
main.xml
How get position of a View.
MainClass.java
/*
public void scrollTo (int x, int y)
Since: API Level 1
Set the scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int) and the view will be invalidated.
This version also clamps the scrolling to the bounds of our child.
Parameters
x the x position to scroll to
y the y position to scroll to
*/
// sroll to top of hscrollViewMain
ScrollView hscrollViewMain = (ScrollView)findViewById(R.id.scrollViewMain);
hscrollViewMain.scrollTo(0, 0); // scroll to application top
// get position of a View
EditText hEdit = (EditText)findViewById(R.id.username_edit);
int nY_Pos = hEdit.getTop(); // getBottom(); X_pos getLeft(); getRight();
// scroll to top of hEdit
hscrollViewMain.scrollTo(0,nY_Pos);
main.xml
<LinearLayout
xmlns:android="//schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ScrollView
android:id="@*id/scrollViewMain"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="5dip"
android:paddingBottom="13dip"
android:paddingLeft="20dip"
android:paddingRight="20dip">
<TextView
android:id="@+id/message"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip" />
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login_activity_username_label" />
<EditText
android:id="@+id/username_edit"
android:singleLine="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minWidth="250dip"
android:scrollHorizontally="true"
android:capitalize="none"
android:autoText="false"
android:inputType="textEmailAddress" />
</LinearLayout>
</ScrollView>
</LinearLayout>
Eclipse update ADT 17 Android Emulator error: E/AndroidRuntime(370): java.lang.NoClassDefFoundError: com.google.ads.AdView
Solution:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Order and Export
-check GoogleAdMobAdsSdk-4.0.4.jar (or your version SDK)
-press OK
-clean project by menu Project -> Clean
-rebuild project (Project - Build Automatically)
How add GoogleAdMobAdsSdk....jar to project:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Libraries
-press the button Add External JARs...
-select your version GoogleAdMobAdsSdkXXX.jar what you can using
-OK
-OK
-clean project
-rebuild project
Solution:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Order and Export
-check GoogleAdMobAdsSdk-4.0.4.jar (or your version SDK)
-press OK
-clean project by menu Project -> Clean
-rebuild project (Project - Build Automatically)
How add GoogleAdMobAdsSdk....jar to project:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Libraries
-press the button Add External JARs...
-select your version GoogleAdMobAdsSdkXXX.jar what you can using
-OK
-OK
-clean project
-rebuild project
No executable code found at line ....
Try one from this solution:
1.) uninstall app from test device, try to debugg app
or
2.) open module gradle file and set minifyEnabled to false in debug condition
Try one from this solution:
1.) uninstall app from test device, try to debugg app
or
2.) open module gradle file and set minifyEnabled to false in debug condition
debug {
minifyEnabled false
}
PNG, GIF, BMP, JPG
// //www.apache.org/licenses/LICENSE-2.0
// 1.) Bitmap from stream
InputStream is = context.getResources().openRawResource(R.drawable.my_image);
mBitmap = BitmapFactory.decodeStream(is);
// 2.)
Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.ball);
int dstWidth =120;
int dstHeight = 120;
mBitmap = Bitmap.createScaledBitmap(ball, dstWidth, dstHeight, true);
// 3.)
Bitmap mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
Bitmap mBitmap;
Canvas mCanvas;
Paint mBitmapPaint;
mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
mCanvas = new Canvas(mBitmap);
mBitmapPaint = new Paint(Paint.DITHER_FLAG);
// 4.)
Bitmap mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.RGB_565);
Canvas mCanvas.setBitmap(mBitmap);
mCanvas.drawColor(0xFFFFFFFF);
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: 2015-12-05 12:16:39
Počet článků v kategorii: 396
Url:android-google-maps-night-mode