这是一个很长的布局代码的一部分.所以发布整个代码是没有用的.
我要对齐的RED circle.Both的位置在红色圆圈表示.
在ParentLayout整个活动的一个RelativeLayout,但没有任何与此有关.
请帮助我.我已经尝试了所有我认识的事情.
<LinearLayout
android:id="@+id/thumbnail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/texttitle"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/Layoutborder"
>
<LinearLayout
android:id="@+id/Linearimagetop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:layout_alignParentLeft="true"
android:background="@drawable/image_bg"
>
<ImageView
android:id="@+id/productimage1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/defaultimage"
android:layout_below="@+id/texttitle"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Availability "
android:textColor="@color/black"
android:textStyle="normal" />
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="@color/black"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"/>
<TextView
android:id="@+id/availibility"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="In Stock"
android:textColor="#4A7023"
android:textStyle="normal"
android:layout_marginLeft="3dp"/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我想显示AlertDialog所有活动的通用.
在我的后台线程中,服务器数据会定期出现.
现在,如果某些用户定义的条件与该数据匹配,我想在屏幕AlertDialog上显示当前正在进行的任何活动.
如何识别显示位置AlertDialog?
如果我的应用程序是在后台,我想设置Notifications而不是AlertDialog.
我正在处理碎片.
我有一个Activity不同的fragments.
每个人都fragment需要访问Class(call it X)允许它访问数据库,但是,因为我有很多片段,所以我不想Class X在每个片段中创建不同的实例,因为我认为它需要很多memory.
那我该怎么办?
我写了这样的东西(带有吸气剂),但它不起作用!
public class MyActivity {
private ClassX classx;
.....
public ClassX getClassX() {
return classx;
}
.....
}
Run Code Online (Sandbox Code Playgroud)
但是,我怎么能从中调用呢fragment?
我试图通过按后退按钮断开呼叫,应用程序崩溃与此错误.我在eclipse上使用Pierre Chabardes的AndroidRTC应用程序. https://github.com/pchab/AndroidRTC
我还通过linux机器构建了最新的WebRTC libjingle_peerconnection_so.so和libjingle_peerconnection.jar.
04-10 12:20:16.695: E/rtc(29060): #
04-10 12:20:16.695: E/rtc(29060): # Fatal error in ../../talk/app/webrtc/java/jni/peerconnection_jni.cc, line 926
04-10 12:20:16.695: E/rtc(29060): # Check failed: 0 == (reinterpret_cast<MediaSourceInterface*>(j_p))->Release() (0 vs. 1)
04-10 12:20:16.695: E/rtc(29060): # Unexpected refcount.
04-10 12:20:16.695: E/rtc(29060): #
04-10 12:20:16.695: A/libc(29060): Fatal signal 6 (SIGABRT), code -6 in tid 29060
Run Code Online (Sandbox Code Playgroud) 我有这个代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ListView lv = (ListView) findViewById(R.id.lvResult);
ListAdapter listAdapter = new ListAdapter(Prueba.this, imageList, list1, list2);
lv.setAdapter(listAdapter);
}
Run Code Online (Sandbox Code Playgroud)
它给出了一个错误:
Cannot instantiate the type ListAdapter
在同一个包中,我创建了一个ListAdapter.java用其代码调用的类.
我不知道那个错误意味着什么.