小编osi*_*the的帖子

将标签放在屏幕的底部

我想在屏幕的底部放置标签.为此,我有以下代码:

package info.androidhive.tabsswipe;

import info.androidhive.tabsswipe.adapter.TabsPagerAdapter;
import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

public class MainActivity extends FragmentActivity implements
        ActionBar.TabListener {

    private ViewPager viewPager;
    private TabsPagerAdapter mAdapter;
    private ActionBar actionBar;
    // Tab titles
    private String[] tabs = { "Top Rated", "Games", "Movies" };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Initilization
        viewPager = (ViewPager) findViewById(R.id.pager);
        actionBar = getActionBar(); 
        mAdapter = new TabsPagerAdapter(getSupportFragmentManager());

        viewPager.setAdapter(mAdapter) ;
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);

        // Adding Tabs
        for (String tab_name : …
Run Code Online (Sandbox Code Playgroud)

java android android-fragments android-tabs

15
推荐指数
2
解决办法
2万
查看次数

如何以编程方式在Android中将短信应用设置为默认应用

我已经开发了一个Android应用程序,用于接收来自特定号码的短信。它可以将短信标记为从该号码读取。要将短信标记为已读,需要将应用程序设置为默认值。如何在Android中以编程方式将应用设置为默认设置?

android

11
推荐指数
3
解决办法
2524
查看次数

如何在android中显示饼图

我想构建一个应用程序,我想在饼图中显示内存和CPU使用率图.但是我不知道如何实现它.

我见过以下问题:

如何在android中异步显示3D饼图?

但我无法解决这个问题.我能做什么 ?伙计们,你能帮我这方面吗?

android pie-chart

9
推荐指数
1
解决办法
6064
查看次数

运行名为"未指定SDK"的Ruby代码时出错

我已经下载了RubyMine IDE来运行ruby代码.我写了以下代码:

puts 'hellow world'
Run Code Online (Sandbox Code Playgroud)

但是当我想运行这个最小的程序时,我有一个错误.IDE显示以下错误.

"No SDKs specified"
Run Code Online (Sandbox Code Playgroud)

为什么?如果我想解决这个问题该怎么办?我是这种语言的初学者.你能在这方面帮助我吗?我也想要你的建议."RubyMine"是Ruby最好的IDE吗?你使用什么IDE?

ruby rubymine

8
推荐指数
1
解决办法
2万
查看次数

android中listview项的边框

我想设置Edittext的边框和listview的项目,如图所示:

在此输入图像描述

我的xml代码如下:

    <LinearLayout
        android:background="#BDD6E0"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="vertical"  >

    </LinearLayout>

    <LinearLayout
        android:background="#BDD6E0"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="vertical"  >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Search"
            android:textColor="#000000"
            android:background="#FFFFFF"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <EditText
            android:id="@+id/search_pat_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" 
            android:singleLine="true"
            android:textColor="#000000"
            android:layout_weight="4">

        </EditText> 

    </LinearLayout>

    <LinearLayout
        android:background="#c0c0c0"
        android:layout_height="0dp"
        android:layout_width="match_parent"
        android:layout_weight="6" >

            <ListView
            android:id="@+id/listView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:layout_weight="1" >
            </ListView>

    </LinearLayout>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

如何在listview的项目中绘制边框?

xml android listview

7
推荐指数
2
解决办法
3万
查看次数

如何在Android中获取ImageView的图像名称?

我在android中有一个imageview.我想获取在imageview中设置的图像的名称.我怎样才能做到这一点 ?

ImageView v = (ImageView)findViewbyId(R.id.img);
//String name = findImageName(v);
if( name.equals(a))
{
   //do something
} 
else{
   //do something
}
Run Code Online (Sandbox Code Playgroud)

android image imageview

7
推荐指数
1
解决办法
2万
查看次数

Android DDMS中的数据文件夹为空

我想看看mt数据库文件.这就是为什么我在Android工作室中使用工具 - > Android - > Android Device Monitor.然后我得到了以下图片:

在此输入图像描述

但是数据文件夹是空的.为什么数据文件夹为空?如何访问我的数据库文件?任何建议都有很大帮助.

database android android-studio

7
推荐指数
2
解决办法
1万
查看次数

如何在CSipSImple中添加SIP联系人列表及其在线状态?

我正在学习在Csipsimple上添加一个SIP联系人列表.我正在寻找如何通过pjsip获取联系人的在线状态.

在org.pjsip.pjsua.pjsipJNI.java中,我读了这些行.我可以使用它们从SIP服务器获取某人的在线状态吗?

public final static native int pjsua_acc_info_online_status_get(long jarg1, pjsua_acc_info jarg1_);
  public final static native long pjsua_acc_info_online_status_text_get(long jarg1, pjsua_acc_info jarg1_);
Run Code Online (Sandbox Code Playgroud)

当然,我也在org.pjsip.pjsua.pjsua_acc_info中读过这些行.但我不知道应该怎么用,因为它似乎不适合读取一个联系人的状态.

    public int getOnline_status() {
        return pjsuaJNI.pjsua_acc_info_online_status_get(swigCPtr, this);
      }

  public void setOnline_status_text(pj_str_t value) {
    pjsuaJNI.pjsua_acc_info_online_status_text_set(swigCPtr, this, pj_str_t.getCPtr(value), value);
  }
Run Code Online (Sandbox Code Playgroud)

你可以帮帮我吗!任何建议都有很大帮助.

android csip-simple

6
推荐指数
0
解决办法
552
查看次数

如何更新Android中的现有通知?

我正在使用以下代码来显示通知。显示通知后,如果单击通知,我将进入活动。

void Notify(String notificationTitle, String notificationMessage){
        NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notification = new Notification(R.drawable.noti, notificationTitle,System.currentTimeMillis());

        Intent notificationIntent = new Intent(this, SmsActivity.class);

        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
                | Intent.FLAG_ACTIVITY_SINGLE_TOP);

        PendingIntent intent = PendingIntent.getActivity(this, 0,
                notificationIntent, 0);

        notification.setLatestEventInfo(this, notificationTitle,notificationMessage, intent);
        notification.flags |= Notification.FLAG_AUTO_CANCEL;
        notificationManager.notify(0, notification);
       } 
Run Code Online (Sandbox Code Playgroud)

现在,我想更新通知文本。我怎样才能做到这一点 ?

android push-notification

4
推荐指数
3
解决办法
7379
查看次数

DBMS_OUTPUT.PUT_LINE没有打印任何内容

执行以下代码时,它只是说过程已完成,并且不打印信息.

BEGIN
 dbms_output.put_line('This is my first program');
END;
/
Run Code Online (Sandbox Code Playgroud)

当我执行上面的代码时,编译器说,PL/SQL过程已成功完成,但不会向控制台打印任何内容.我能做什么 ?

plsql sqlplus oracle10g dbms-output

4
推荐指数
1
解决办法
1万
查看次数