小编Sol*_*uiD的帖子

在OnTouch中返回true和false?

不要紧,如果我返回truefalseonTouch()OnTouchListener?我看不到返回truefalse在此示例中的任何区别:Android在桌面上滑动

android return list swipe ontouch

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

获取用于调试应用程序的 Crashlytics DSYM

我如何获得调试应用程序的 DSYM(未在 AppStore 上发布)?...

我从这个答案中知道调试会话不允许向 Fabric 报告崩溃和错误,但是在我断开设备与 xcode 的连接后,我的崩溃日志被报告并需要 DSYM,在这种情况下我如何获得它们?

另请注意,我正在使用Crashlytics.recordError(error)而不是强制崩溃来记录非致命错误。

ios firebase crashlytics twitter-fabric firebase-crash-reporting

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

未检测到我的MotionEvent.ACTION_DOWN

我的问题是检测到所有触摸事件,但没有检测到Action_Down事件。该日志会导致事件1、2而不是0(向下)。

这是我的代码

final ViewPager homeViewPager = (ViewPager)findViewById(R.id.homeViewPager);

    homeViewPager.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch (View v, MotionEvent event){
                Log.i("ViewPager", "event " + event.getAction());
                switch (event.getAction()) {
                    case MotionEvent.ACTION_MOVE:
                        Log.i("ViewPager", "ACTION_MOVE");
                        break;
                    case MotionEvent.ACTION_DOWN:
                        Log.i("ViewPager", "ACTION_DOWN");
                        break;
                    case MotionEvent.ACTION_UP:
                        Log.i("ViewPager", "ACTION_UP ");
                        break;
                }
            return false;
        }
    });
Run Code Online (Sandbox Code Playgroud)

android ontouchlistener android-viewpager motionevent

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

Android - 收到通知但没有通知弹出窗口(前景)

我的应用正在正确接收通知,但未能显示收到信息的通知(如果应用已打开).

注意:如果应用程序在后台,则会显示通知而不会出现任何问题.


我的代码:

我收到此方法的通知:

@Override
public void onMessageReceived(RemoteMessage remoteMessage)
{
    Log.d(TAG, "From: " + remoteMessage.getFrom());

    if(remoteMessage!=null)
    {
        String id = null;
        String title = null;
        String body = null;
        String launchPage = null;

        if(remoteMessage.getNotification()!=null)
        {
            title = remoteMessage.getNotification().getTitle();
            body = remoteMessage.getNotification().getBody();
        }

        if(remoteMessage.getMessageId()!=null)
        {
            id = remoteMessage.getMessageId();
        }

        Log.i(TAG, "id: " + id);
        Log.i(TAG, "title: "+ title);
        Log.i(TAG, "body: " + body);

        int notif_id = 0;

        sendNotification(notif_id, title, body, launchPage);
    }
}
Run Code Online (Sandbox Code Playgroud)

然后它调用这个(它应该显示我理解的通知):

private void sendNotification(int id, String title, String …
Run Code Online (Sandbox Code Playgroud)

notifications android firebase google-cloud-messaging

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