在这里你是我的问题:我想在android中做一个看起来像这个网格的布局:

为此,我创建了这个布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3">
<Button
android:id="@+id/clientimain"
android:layout_width="0dip"
android:layout_weight="1" android:layout_height="fill_parent"/>
<Button
android:id="@+id/button1"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Button" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3" >
<Button
android:id="@+id/button2"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Button"/>
<Button
android:id="@+id/button6"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Button" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3" >
<Button
android:id="@+id/button3"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Button"
/>
<Button
android:id="@+id/button7"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Button"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
所以基本上它由表格布局中的6个按钮组成,正确设置了权重属性(或者我希望如此!).结果看起来很好,直到我尝试设置每个按钮的背景属性.在这种情况下,按钮获取放入的图像的高度(宽度正常).例如,如果我设置大小为96px …
我是Android开发人员.在我的工作中,我必须每天上传一个新版本的应用程序.
问题是将近三到四周我每次尝试上传到市场时都会出现以下错误.
The server could not process your apk. Try again.
Run Code Online (Sandbox Code Playgroud)
重试近20次后,应用程序正在上传.任何人都可以解释发生了什么,问题是我的还是在Android市场....请给我一个解决方案.
提前致谢.
此致,狙击手
我正在使用一个使用Geopoints的Android应用程序,我想从另一个Geopoint确定一个Geopoint,一个距离(任何格式)和一个极角.例如,我想通过手机中的GPS获取我位置的北 - 东北(22,5度)100米处的坐标.
我发现的唯一方法是Location.distanceBetween(...).
现在我正在开发一个应用程序.通过我的应用程序用户可以阅读pdf文件,如果没有pdf阅读器,那么我的应用程序将自动从网站安装它.这是我用来阅读pdf文件的代码.
File file = new File("/sdcard/sample.pdf");
PackageManager packageManager = getPackageManager();
Intent testIntent = new Intent(Intent.ACTION_VIEW);
testIntent.setType("application/pdf");
List list = packageManager.queryIntentActivities(testIntent, PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0 && file.isFile()) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri uri = Uri.fromFile(file);
intent.setDataAndType(uri, "application/pdf");
startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
我的怀疑是:
我有一个非常基本的问题.我试图读取三个EditText字段的值,并使用arrayadapter将它们保存为arraylist中的一个项目.我的问题是如何将我从EditTexts中读取的三个变量分组并将它们作为单个项添加到arraylist中?
我知道有许多系统用户ID和许多与用户应用程序相对应的UID.所以我有以下问题:
我正在点击 apk 文件,它提示安装,但很快就停止了,没有说明它是否已安装或问题是什么。我怎么知道为什么它没有安装?此类信息的日志在哪里?
我得到了 5MB 的 JSON 响应,我正在使用大小为 1024 的字节数组下载并保存在 StringBuffer 中。
要解析此响应,我必须创建一个 JSONObject,参数为字符串。在将响应转换为字符串时,我得到一个out of memory exception(stringBufferVar.toString()).
从服务中,我将收到以下响应,最多 5 个附件,每个附件的最大 5MB 数据为 Base64 编码。
以下是服务的响应。
{"result":[{"attachment":{"name":"one.doc", "type":"document", "data":"base64 encoded data max of 5MB"}, {"attachment":{"name":"two.txt", "type":"text", "data":"base64 encoded data max of 5MB"} }] }
Run Code Online (Sandbox Code Playgroud)
我将在列表中显示附件,当用户单击一个项目时,我必须将该附件保存在 SDCard 中。为此,我如何解析和保存 JSON 中的大量数据。
请提供任何解决方案。
提前致谢。
我对dalvik vm(Android)感兴趣.我试图通过JIT的代码来找出它执行的操作以及它如何选择跟踪.我无法遵循代码.所以我请求所有人通过在JIT中建议执行跟踪选择和转换的相关功能来帮助我
android ×10
android-maps ×1
arraylist ×1
button ×1
dalvik ×1
google-play ×1
gps ×1
java ×1
jit ×1
json ×1
layout ×1
linux-kernel ×1
parsing ×1
tablelayout ×1