小编Jea*_*les的帖子

Android:使用intent共享纯文本(对所有消息传递应用程序)

我正在尝试使用intent分享一些文本:

Intent i = new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");  
i.putExtra(android.content.Intent.EXTRA_TEXT, "TEXT");
Run Code Online (Sandbox Code Playgroud)

和选择器翘曲:

startActivity(Intent.createChooser(sms, getResources().getString(R.string.share_using)));
Run Code Online (Sandbox Code Playgroud)

有用!但仅适用于电子邮件应用.
我需要的是所有消息应用程序的一般意图:电子邮件,短信,IM(Whatsapp,Viber,Gmail,SMS ...)尝试使用android.content.Intent.ACTION_VIEW 并尝试使用i.setType("vnd.android-dir/mms-sms");任何帮助...

("vnd.android-dir/mms-sms"仅使用sms共享!)

email sms android android-intent

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

如何将记录器包装在slf4j中?

是否可以将记录器包装为slf4j?

例如,在调试模式下,当我检查时org.slf4j.LoggerFactory.getLogger(loggerName),我可以看到记录器(这里java.util.logging):

java.util.logging记录器

我想做的事情如下:

// Get the real logger, cast in java.util.logging
java.util.logging.Logger myLogger = LoggerFactory.getLogger(loggerName))...;
// Use the java.util.logging methods
myLogger.setLevel(Level.parse(level)); 
Run Code Online (Sandbox Code Playgroud)

java logging slf4j java.util.logging

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

如何从 Apache 安装 HttpClient 库?

import org.apache.http.client.*;

我想导入这个java包,它说它不存在,那么我应该从哪里下载这个包,在哪里安装它?

java installation httpclient

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

更改richfaces中使用的JQuery版本

我正在使用richfaces 3_3_3.Final,我不想使用最新的jQuery http://code.jquery.com/jquery-latest.pack.js,但它似乎有冲突.

Richfaces已经加载了一个jQuery版本(女巫不是合适的版本,似乎是1.3.2):

<script type="text/javascript" src="/project/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/jquery/jquery.js.jsf">
Run Code Online (Sandbox Code Playgroud)

我可以在我的Javascript流程中使用最新版本,并允许RichFaces使用自己的版本,以及如何使用?

jQuery.noConflict()是一个很好的研究领域吗?

jquery richfaces

5
推荐指数
1
解决办法
6228
查看次数

单击时如何将喜爱的星形图标设置为ON,再次单击android时将其设置为OFF

我的包含引号列表的活动如下.

package bank.quotes.famous;
import android.os.Bundle; 
import android.view.View; 
import android.view.View.OnClickListener; 
import android.widget.CheckBox;

public class QuotesActivity extends FamousQuotesActivity  { 
     @Override 
     public void onCreate(Bundle savedInstanceState)  { 

         super.onCreate(savedInstanceState); 
         setContentView(R.layout.quoteslayout); 

         CheckBox favButton = (CheckBox)findViewById( R.id.favbutton );
Run Code Online (Sandbox Code Playgroud)

我试过在这里添加你的代码没有成功.我的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="match_parent" 
    android:orientation="vertical" > 

    <ScrollView 
        android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="856dp"
        android:background="@android:color/white"
        android:orientation="vertical" >

        <TableRow
            android:id="@+id/TableRow03"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.25" >

            <RelativeLayout
                android:id="@+id/RelativeLayout08"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/forquotesgrey" >



                <TextView
                    android:id="@+id/TextView22"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:text="@string/albertquote"
                    android:textAppearance="?android:attr/textAppearanceMedium" />


                <TextView
                    android:id="@+id/TextView21"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentRight="true"
                    android:text="@string/alberteinstein" …
Run Code Online (Sandbox Code Playgroud)

android

5
推荐指数
1
解决办法
5395
查看次数

Javascript中两个日期初始化的差异

为什么这两个日期不同:

var date1 = new Date();
date1.setFullYear(2012); // year (four digits)
date1.setMonth(10); // month (from 0-11)
date1.setDate(1); // day of the month (from 1-31)

var date2 = new Date(2012, 10, 1, 0, 0, 0, 0);
Run Code Online (Sandbox Code Playgroud)

结果:

Date 1 : Sat Dec 01 2012 14:56:16 GMT+0100
Date 2 : Thu Nov 01 2012 00:00:00 GMT+0100
Run Code Online (Sandbox Code Playgroud)

而这两个日期是等于:

var date3 = new Date();
date3.setFullYear(2012); // year (four digits)
date3.setMonth(9); // month (from 0-11)
date3.setDate(1); // day of the month …
Run Code Online (Sandbox Code Playgroud)

javascript datetime date

5
推荐指数
1
解决办法
306
查看次数