小编ssr*_*srp的帖子

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

如何将字符串值从活动传递给webView

请告诉我如何将一些字符串值从活动传递到webview.我在DashboardActivity中加载了带有加载URL的webview,我想将该活动的字符串值传递给javaScript window.onload函数使用的webview.请告诉我一个这样做的方法.

javascript android webview

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

Onclick监听器方法中的警报对话框

  rdmrbtn.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {

                AlertDialog alert = new AlertDialog.Builder(getApplicationContext()).create();
                alert.setTitle("No Internet access");
                alert.setMessage("You can't reach the discussion from the Offline mode");
                alert.setButton("OK", new OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub

                    }
                })
            }
        });
Run Code Online (Sandbox Code Playgroud)

我想在点击readmore按钮("rdmrbtn")时显示上述警报.但它给了我一些编译错误.拜托,请你帮帮我吧.谢谢.

android android-alertdialog

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

如何在ubuntu 12.04中设置Android SDK,NDK和JDK路径

下面是我的.bashrc文件

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
$export=$PATH:./home/ssrp/workspace/android-sdk-linux/platform-tools
$export PATH=$PATH:./home/ssrp/workspace/android-sdk-linux/tools
$export JAVA_HOME=./usr/lib/jvm/java-6-openjdk
$export NDK=./home/ssrp/workspace/android-ndk-r9
# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and …
Run Code Online (Sandbox Code Playgroud)

terminal ubuntu android path environment-variables

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

android中的ClassDefNotFound错误

  new Thread(new Runnable() {
                public void run() {
                    HttpClient client = new DefaultHttpClient();
                    HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit
                    HttpResponse response;
                    JSONObject json = new JSONObject();
                    try{
                        HttpPost post = new HttpPost(URL);
                        post.setHeader("Content-type", "application/json");
                        json.put("username", userName);
                        json.put("password", password);
                        StringEntity se = new StringEntity( json.toString());
                        se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                        post.setEntity(se);
                        response = client.execute(post);
                        /*Checking response */
                        if(response!=null){
                            String temp = EntityUtils.toString(response.getEntity()); //Get the data in the entity
                            JSONObject json2 = (JSONObject)new JSONParser().parse(temp);

                            //JsonObject o = new JsonParser().parse(temp).getAsJsonObject();
                            Log.v("response", json2.get("state").toString());
                    }}
                    catch(Exception e){
                        e.printStackTrace();
                        //createDialog("Error", …
Run Code Online (Sandbox Code Playgroud)

android json

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

如何在Jquery中将浮点值舍入为其最接近的整数

我想将两个130.68(大于或等于130.5)和131.32(小于131.5)的值舍入到131.

floating-point int jquery rounding

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

如何在Jquery中通过其样式值获取元素

我有以下div

<div class="timeline-axis-grid timeline-axis-grid-minor" style="position: absolute; width: 0px; top: 20px; height: 369px; left: 53.3095px;"></div>
Run Code Online (Sandbox Code Playgroud)

我想通过它的'left:53.3095px'值得到这个div并分配给Jquery中的变量

html css jquery

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

如果使用==的语句给出了意外的结果

private void refineWords() {
    for(String word : words){
        Log.i("word", word);
        if (word == "s" || word == "t" || word == "am" || word == "is" || word == "are" || word == "was" || word == "were" || word == "has" || 
            word == "have" || word == "been" || word == "will" || word == "be" || word == "would" || word == "should" || word == "shall" || 
            word == "must" || word == "can" || word …
Run Code Online (Sandbox Code Playgroud)

java methods

-1
推荐指数
2
解决办法
708
查看次数