我正在制作应用程序的UI.当我试图在EditText键盘中输入值时,向上移动UI.当键盘打开时请帮助我,它不应该向上移动UI.
<activity
android:name=".AddProductsActivity"
android:configChanges="orientation"
android:hardwareAccelerated="false"
android:windowSoftInputMode="adjustResize" />
Run Code Online (Sandbox Code Playgroud) 我正在使用OpenGl Es库来渲染3D对象.我得到异常OutofMemoryError我在谷歌尝试和搜索但无法获得成功
请帮我解决这个问题.
package com.amplimesh.models;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.opengl.GLUtils;
import android.util.Log;
import com.amplimesh.util.Point3;
public class ObjModel {
public void bindTextures(Context context, GL10 gl) {
Bitmap bitmap;
try {
InputStream is = context.getAssets().open("textures/"+mTextureName);
bitmap = BitmapFactory.decodeStream(is);
if (bitmap == null) {
Log.v("ObjModel", "err loading bitmap!");
}
} catch (java.io.IOException e) {
Log.v("ObjModel", "err loading tex: "+e.toString());
return; …Run Code Online (Sandbox Code Playgroud) 我正在进行布局并使用layout_weight和weight_sum.我正在将线性布局的方向设置为水平,这样我就可以设置屏幕的1/3视图宽度.但我不知道如何将imageview的高度设置为屏幕的1/3.
请帮我将imageview高度设置为布局xml的屏幕的1/3.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1">
<ImageView
android:id="@+id/savedImageView"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".33"
android:background="@drawable/background" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
提前致谢
我是Android的新手并且开始了A - B - C - D活动.从活动D开始,当我再次打开活动A时,我怎么能开始这样活动B和C没有完成而A再次开始?应该只有一个活动A.
提前致谢.
我是android的新手,并尝试使用Intent将多个文件发送到gmail.但它不发送附件.请帮帮我.
以下是我的代码:
Intent targetedShare = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
targetedShare.setType("image/*"); // put here your mime type
targetedShare.putExtra(Intent.EXTRA_SUBJECT, "Amplimesh Photo");
targetedShare.putExtra(Intent.EXTRA_TEXT,"Attached the Quote");
ArrayList<Uri> uris = new ArrayList<Uri>();
//Fetching the Installed App and open the Gmail App.
for(int index = 0; index < productList.size(); index++) {
ByteArrayInputStream byteInputStream = new ByteArrayInputStream(productList.get(index).getOverlayBitmap());
Bitmap overLayBitmap = BitmapFactory.decodeStream(byteInputStream);
String fileName = SystemClock.currentThreadTimeMillis() + ".png";
//Save the bitmap to cache.
boolean isSaved = Helper.saveImageToExternalStorage(overLayBitmap, getApplicationContext(), fileName);
if(isSaved)
uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/amplimesh", fileName)));
}
targetedShare.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivityForResult(Intent.createChooser(targetedShare, "Sending …Run Code Online (Sandbox Code Playgroud)