我在android编程中有以下代码
Button btn1 = ( Button ) findViewById( R.id.btn1 );
Button btn2 = ( Button ) findViewById( R.id.btn2 );
Button btn3 = ( Button ) findViewById( R.id.btn3 );
Button btn4 = ( Button ) findViewById( R.id.btn4 );
Button btn5 = ( Button ) findViewById( R.id.btn5 );
Button btn6 = ( Button ) findViewById( R.id.btn6 );
Button btn7 = ( Button ) findViewById( R.id.btn7 );
Button btn8 = ( Button ) findViewById( R.id.btn8 );
Button btn9 = ( Button ) findViewById( …Run Code Online (Sandbox Code Playgroud) 我的目标是低于图像
我在下面编码
row_right.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/me"
android:layout_gravity="right"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:layout_marginLeft="5dp"
android:layout_marginRight="15dp"
android:layout_gravity="right"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="15sp"
android:textColor="#000000"
android:text="TextView" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="15dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/dataAndTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="15sp"
android:textColor="#001199"
android:text="gggggggghyjkljgfdgjlkhfdhklggg" />
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
row_left.xml
<?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="wrap_content"
android:background="@drawable/you"
android:layout_gravity="left"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:layout_marginLeft="5dp"
android:layout_marginRight="15dp"
android:layout_gravity="right"
android:layout_marginTop="5dp" …Run Code Online (Sandbox Code Playgroud) 在提出这个问题之前,我搜索并找到了以下链接:
MyFirstApp安装在模拟器上但无法启动它
安装后Android应用程序无法打开.但它可以在模拟器上运行,
而不是在模拟器上启动
他们都没有解决我的问题.
这是我的第一个应用程序,我将其创建为一个新的androidProject.所以代码没有任何问题.我使用linux,我的控制台显示以下内容:
[2013-05-30 14:06:36 - Hello] Android Launch!
[2013-05-30 14:06:36 - Hello] adb is running normally.
[2013-05-30 14:06:36 - Hello] Performing com.example.hello.MainActivity activity launch
[2013-05-30 14:06:36 - Hello] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2013-05-30 14:06:39 - Hello] Uploading Hello.apk onto device 'emulator-5554'
[2013-05-30 14:06:40 - Hello] Installing Hello.apk...
[2013-05-30 14:07:26 - Hello] Success!
[2013-05-30 14:07:27 - Hello] Starting activity com.example.hello.MainActivity on device emulator-5554
Run Code Online (Sandbox Code Playgroud)
UPDATE 1
当我在手机中运行项目时,应用程序运行outo但没有在模拟器中运行.为什么?
UPDATE 2 …
我有下面的代码:
#include<iostream>
#include <vector>
using namespace std;
template<class T>
class Stack
{
private:
vector<T> stack;
public:
T Pop()
{
if (stack.size()!=0)
{
T temp;
temp=stack[stack.size()-1];
stack.erase(stack.begin()+stack.size()-1);
return temp;
}
else
//return nothing
^^^^^^^^^^^^^^^^
//How i can do above by code
}
Run Code Online (Sandbox Code Playgroud)
在pop功能中:我想要stack.size==0; 弹出功能什么都不返回
我怎么能这样做?
我使用下面的代码来搜索谷歌地图android
// An AsyncTask class for accessing the GeoCoding Web Service
private class GeocoderTask extends AsyncTask<String, Void, List<Address>>{
@Override
protected List<Address> doInBackground(String... locationName) {
// Creating an instance of Geocoder class
Log.d("bagibagi","doInBackground");
Geocoder geocoder = new Geocoder(getBaseContext());
List<Address> addresses = null;
try {
addresses = geocoder.getFromLocationName(locationName[0], 1);
} catch (IOException e) {
e.printStackTrace();
}
return addresses;
}
@Override
protected void onPostExecute(List<Address> addresses) {
Log.d("bagibagi","onPostExecute");
search = "";
if(addresses==null || addresses.size()==0){
Toast.makeText(getBaseContext(), "No Location found OR you use this several time", …Run Code Online (Sandbox Code Playgroud)