相关疑难解决方法(0)

问题:将大数据传递给第二个Activity

我有一个奇怪的问题.我环顾网络但没有找到答案.我还是android编程的初学者.让我们走吧:

我想做的就是用一些数据调用第二个Activity.它适用于小数据,但如果数据变大,第二个Activity将不会显示,第一个Activity将完成.这是我调用方法的代码:

Intent intent = new Intent(ActivitySearch.this,ActivityResults.class);
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("data", searchList);
intent.putExtras(bundle);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

接收数据的部分并不重要.即使我不尝试读取该包,也不会调用该活动.我用以下几行测试了这个:

@Override
public void onCreate(Bundle savedInstanceState) {
Log.d("DEBUG","ActivityResult::onCreate()");
super.onCreate(savedInstanceState);
Run Code Online (Sandbox Code Playgroud)

OnCreate() 永远不会被召唤.

也许你的一个人有个主意......谢谢你的帮助!

编辑:至少我忘了:这只发生在ICS下.该应用程序就像一个姜饼和froyo的魅力.

Edit2:Logcat

10-10 14:49:46.951: D/OpenGLRenderer(21696): Flushing caches (mode 0)
10-10 14:49:47.011: V/ActivityThread(22429): com.example.amazonsearch white listed for hwui
10-10 14:49:50.821: W/IInputConnectionWrapper(21696): showStatusIcon on inactive InputConnection
Run Code Online (Sandbox Code Playgroud)

java android android-activity android-4.0-ice-cream-sandwich

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

Intent putExtra方法的最大长度?(强制关闭)

我需要一些调试我的应用程序的帮助.首先:在模拟器和其他设备上,我的应用运行正常.在我的设备上,我关闭了一个力(没有强制关闭消息).

如果应用程序的活动发生更改,则会发生"崩溃".

这是MainActivity该类的一些代码.它只是通过webview从网页上读取html内容.不,这是不可能的,HttpRequest因为我无法模拟发布请求.

public class MainActivity extends Activity {

    public final static String EXTRA_HTML = "com.example.com.test.HTML";

    private WebView mWebView;
    private ProgressDialog mDialog;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);  
        mWebView = (WebView) findViewById(R.id.webView1);
        CookieSyncManager.createInstance(this);
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.removeAllCookie();
        mWebView.setBackgroundColor(0);
        mWebView.setWebChromeClient(new WebChromeClient() {
            public boolean onConsoleMessage(ConsoleMessage cmsg) {
                if (cmsg.message().startsWith("MAGIC")) {
                    mDialog.cancel();
                    /*HashMap<String, String> message = new HashMap<String, String>();*/
                    String msg = cmsg.message().substring(5);
                    Intent intent = new Intent(MainActivity.this,
                        ReadDataActivity.class);
                    /*message.put("message", msg);*/
                    /*intent.putExtra(EXTRA_HTML, message);*/
                                    intent.putExtra(EXTRA_HTML, msg); …
Run Code Online (Sandbox Code Playgroud)

java android android-intent android-activity

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

使用滑动手势的垂直ViewPager和Android Pie不一致行为

我的问题与另外两个尚未回答的问题密切相关.

ViewPager没有响应在Fragment中动态创建的布局区域中的触摸

/sf/ask/3742870701/

我的垂直ViewPager在我测试的任何设备和任何操作系统5 - 8中运行得非常好.我最近使用Android Pie升级了像素2XL,现在我的Vertical ViewPager似乎没有响应,然后工作,然后就像失去焦点一样,然后工作.拖动页面,它会移动并快速回到原始位置.或者只是反弹回来.再次,类似于上面链接的其他两个问题.

在Android 9之前,垂直滚动和分页是完美的.我尝试使用反射并取得了一些成功.它会刷得更好,似乎也不会失去焦点.但是,如果我尝试用另一只手轻扫,它会停止,或者如果我改变了我滑动的位置,它将会停止.这非常令人困惑.我已经在运行Android 9的设备上添加了复制此问题所需的所有代码.

活动

public class FullscreenActivity extends AppCompatActivity {

VerticalViewPager verticalViewPager;
FragmentStatePagerExample fragmentStatePagerExample;

int pagerPadding;

/**
 * Whether or not the system UI should be auto-hidden after
 * {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
 */
private static final boolean AUTO_HIDE = true;

/**
 * If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
 * user interaction before hiding the system UI.
 */
private static final int AUTO_HIDE_DELAY_MILLIS = 3000;

/**
 * …
Run Code Online (Sandbox Code Playgroud)

android gesture android-viewpager android-9.0-pie

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