我有一个相对布局我要添加一个scrollView,问题是当我添加滚动视图时,我所有相对设置的小部件都丢失了他们的位置,我已经尝试了每一种可能性但我无法设置滚动正确看待,有人可以帮助我吗?我想将滚动视图放到xml文件的所有元素中.
新代码:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff" >
<ImageButton
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="140dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="0.9"
android:background="@drawable/subscribe_second_top"
android:orientation="vertical" >
</ImageButton>
<EditText
android:id="@+id/editText1"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:layout_below="@+id/bebasNeueTextView1"
android:layout_centerHorizontal="true"
android:ems="10"
android:inputType="textEmailAddress" />
<TextView
android:id="@+id/bebasNeueTextView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText1"
android:layout_centerHorizontal="true"
android:text="THE EMAIL YOU WILL USE TO GET ALL YOUR APPS CREATED BY THE SOFT"
android:textColor="#000000"
android:textSize="7sp"
android:textStyle="bold" />
<TextView
android:id="@+id/bebasNeueTextView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText2"
android:layout_centerHorizontal="true"
android:text="YOUR GOOGLE PLAY STORE ORDER NUMBER, IN ORDER TO PROVE YOU BOUG"
android:textColor="#000000"
android:textSize="7sp"
android:textStyle="bold" />
<TextView …Run Code Online (Sandbox Code Playgroud) 背景:
我已经能够XMPP在android中使用asmack库实现一对一聊天.我也可以向服务器发送状态.我在OpenFire基于聊天的应用程序中使用服务器.
问题:
我正在使用connection.addPacketListener(new PacketListener() 接收消息和IQ数据包,对于我已经将它分类的消息包
PacketFilter Chatfilter = new MessageTypeFilter(Message.Type.chat);
connection.addPacketListener(new PacketListener() {
public void processPacket(Packet packet) {
Message message = (Message) packet;
if (message.getBody() != null) {
String fromName = StringUtils.parseBareAddress(message.getFrom());
Log.i("XMPPClient", "Got text [" + message.getBody() + "] from [" + fromName + "]");
messages.add(fromName + ":");
m1=message.getBody();
messages.add(message.getBody());
// Add the incoming message to the list view
/* mHandler.post(new Runnable() {
public void run() {
setListAdapter();
recieve.setText(m1);
}
});*/ …Run Code Online (Sandbox Code Playgroud) 我在解析XML时遇到了麻烦,我尝试了很多东西.
我有像这样的xml.
<question id="1" text="Zodiac Sign" >
<option id="1" >Aries</option>
<option id="2" >Taurus</option>
<option id="3" >Gemini</option>
<option id="4" >Cancer</option>
<option id="5" >Leo</option>
<option id="6" >Virgo</option>
<option id="7" >Libra</option>
<option id="8" >Scarpio</option>
<option id="9" >Sagitarius</option>
<option id="10" >Capricorn</option>
<option id="11" >Acqauarius</option>
</question><question id="2" text="Home Town" >
</question><question id="3" text="Current Locaion" >
</question><question id="4" text="Nationality" ></question>
<question id="5" text="Height" ></question>
<question id="6" text="Build(optional)" >
<option id="13" >Slim</option>
<option id="14" >Athletic</option>
<option id="15" >Few Pounds Extra</option>
<option id="16" >Obese</option>
</question><question id="7" text="Hair Color" …Run Code Online (Sandbox Code Playgroud) 更新: Logcat has been added to the question
我实际上想要改变视图(从一个片段到另一个片段.)button Click我尝试了很多东西,但我无法做到.我还写了一个CustomViewPager停止在刷屏幕时更改页面.它工作正常.
这是我的代码:
MyFragment
public CustomViewPager mViewPager;
public Button next;
public static int count=0;
public static final MyFragment newInstance(String message,ArrayList<String> a)
{
MyFragment f = new MyFragment();
Bundle bdl = new Bundle(1);
bdl.putString(EXTRA_MESSAGE, message);
bdl.putStringArrayList(EXTRA_ARRAY, a);
f.setArguments(bdl);
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
String message = getArguments().getString(EXTRA_MESSAGE);
View v = inflater.inflate(R.layout.myfragment_layout, container, false);
spinner = (Spinner)v.findViewById(R.id.spinoptions);
answer = (EditText)v.findViewById(R.id.answer);
next = …Run Code Online (Sandbox Code Playgroud) 如何在Android应用程序中添加通知计数器,类似于Facebook的通知计数器?我尝试过搜索,但我找不到任何有用的东西.我不想在发射器图标上使用反气球.相反,我希望它在我的应用程序中的通知图标和朋友图标.
我的搜索包括:
包括这些在内的所有其他示例都在启动器图标上显示通知气球.我不希望通知气球通过启动器图标.相反,我希望我的应用程序中的通知气球覆盖类似于Facebook的通知图标.我该如何实现它?任何建议,步骤或指南将不胜感激.

我编写了一个查询来获取一天中每小时收到的数据。
SELECT To_CHAR( A.req_start_time , 'DD/MM/YYYY HH24') as input , count(A.REQUEST_ID)
FROM ILBULK.SAS_RE_TASK_MESSAGE A,ILBULK.SAS_RE_REQUEST_MESSAGE
WHERE A.NE_TYPE = 'HLR'
LIKE '%Synchronous%'
AND A.REQUEST_ID = ILBULK.SAS_RE_REQUEST_MESSAGE.REQUEST_ID and A.REQ_START_TIME > to_DATE ('12/26/2014 00', 'MM/DD/YYYY HH24') and A.REQ_START_TIME < to_DATE('12/27/2014 00', 'MM/DD/YYYY HH24')
GROUP BY To_CHAR(A.REQ_START_TIME, 'DD/MM/YYYY HH24');
Run Code Online (Sandbox Code Playgroud)
我收到以下回复
26/12/2014 02 13823
26/12/2014 14 4681
26/12/2014 12 2939
26/12/2014 18 457
26/12/2014 03 34327
26/12/2014 04 15673
26/12/2014 19 28885
26/12/2014 06 70699
26/12/2014 10 10743
Run Code Online (Sandbox Code Playgroud)
现在我想获取按升序排列的每分钟的数据,我尝试分割时间但没有任何效果。我怎么做?
我想删除字符串特定位置的某些字符.我有这些职位,但我面临着删除角色的问题.
我在做的是:
if (string.subSequence(k, k + 4).equals("\n\t\t\t")){
string = string.subSequence(0, k) + "" + s.subSequence(k, s.length());
}
Run Code Online (Sandbox Code Playgroud)
我需要"\n\t\t\t"从字符串中删除
我在android SQLite中有一个表,我试图弄清楚如何重置KEY_ID,我读到:DELETE FROM tablename应该删除所有内容并将自动增量字段重置为0但是当我这样做时它只是删除数据.插入新记录后,自动增量会在删除之前从中断处继续.我已经实现了一个longitemclicklistner列表,它获取了位置,我想从列表中删除特定项目.这是我的代码
public void deleteContact(Contact contact) {
SQLiteDatabase db = this.getWritableDatabase();
getWritableDatabase().delete(TABLE_CONTACTS, KEY_ID + " = ?",
new String[] { String.valueOf(contact.getID()) } );
db.close();
}
Run Code Online (Sandbox Code Playgroud)
这是代码 onlongclicklistner
public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
int pos, long id) {
// TODO Auto-generated method stub
Log.v("long clicked","pos"+" "+pos);
final int p=pos+1;
final AlertDialog.Builder b = new AlertDialog.Builder(MainActivity.this);
b.setIcon(android.R.drawable.ic_dialog_alert);
b.setMessage("Are you sure you want to DELETE this Entry?");
b.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface …Run Code Online (Sandbox Code Playgroud)