小编Tim*_*Tim的帖子

有没有办法从不扩展Activity类的类调用`overridePendingTransition`?

我正在使用另一个类在后台运行一些东西,同时显示主要活动,并将该活动的上下文传递给此背景类.我正在从这个后台类开始另一个活动,但是我无法在overridePendingTransition这里调用,因为对于类型BackgroundClass,"方法overridePendingTransition(int,int)是未定义的."

public class GetUPC extends AsyncTask<Void, Void, Void> 
{       
    @Override
    protected void onPreExecute() 
    {
        ...
    }
    @Override
    protected Void doInBackground(Void... arg0) 
    {
        ...


                    boolean dairy;
                    if(theDairy.equals("N"))
                    {
                        //milk test
                        dairy=true;
                    }
                    else
                    {
                        dairy=false;
                    }



                    //depending on if there is a warning it will either display the warning screen or skip it
                    if(dairy)
                    {
                        Intent intent_warn = new Intent(context, WarningScreen.class);

                        intent_warn.putExtra("Name", str_name);
                        intent_warn.putExtra("Size", str_size);
                        intent_warn.putExtra("Price", str_price);
                        intent_warn.putExtra("Carbs", str_carbs);
                        intent_warn.putExtra("Protein", str_protein);
                        intent_warn.putExtra("Fiber", str_fiber);
                        intent_warn.putExtra("Sugar", str_sugar);
                        intent_warn.putExtra("SatFat", str_satFat);
                        intent_warn.putExtra("TotFat", str_totFat); …
Run Code Online (Sandbox Code Playgroud)

android transition android-intent android-context android-activity

6
推荐指数
3
解决办法
8100
查看次数

在jQuery对象上调用javascript函数

我试图在我创建的jQuery元素上调用javascript函数,但似乎在函数上运行时不调用该函数.该函数在单独运行时有效,但在另一个jQuery对象上运行时则无效.这是功能:

$(document).ready(function() {
var $Chart = $('#Chart');
/*
 returns true if some Expand element is open
*/
function closeExpand() {
    alert("Hello");
    /*$(this).css("background-color", "black");*/
};
});
Run Code Online (Sandbox Code Playgroud)

它可以在自己调用时运行:http://jsfiddle.net/5F5GF/

$('.ChartLink').click(function() {
    closeExpand();
    });
});
Run Code Online (Sandbox Code Playgroud)

但是当调用另一个jQuery对象时不会:http://jsfiddle.net/dsHRN/

$('.ChartLink').click(function() {
    $Chart.closeExpand();
    });
});
Run Code Online (Sandbox Code Playgroud)

我在这里做错了什么,如何在另一个对象上调用javascript函数?

html javascript css jquery

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

使用Bootstrap,我如何创建多个全屏div以相互堆叠

我想创建一个包含多个100%div的页面,堆叠在一起.类似于Bootstrap封面模板示例,但在第一个屏幕下面有额外的div.我已经尝试过四处寻找,但一直无法找到解决方案.我知道它在那里,也许我只是在寻找错误的东西.

html css twitter-bootstrap

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