Android创建启动器但无法启动其他应用程序

时间:2017-01-10 06:47:22

标签: android cordova cordova-plugins android-launcher

我正在android中创建一个启动器。让我向你解释一下情况。

案例1:当我从android studio运行myLauncher应用程序时,它首先作为普通应用程序运行。然后我在myLauncher中打开app抽屉并单击图标以启动另一个应用程序,它工作正常。退出应用程序后,我再次被带回myLauncher,因为它在Android堆栈上。这是我想要的行为。

案例2:在Android上安装我的应用程序后,按home键选择默认启动器,然后选择myLauncher作为默认启动器。它打开然后我在myLauncher中打开app抽屉。单击任何图标以启动另一个应用程序时,它不起作用。

虽然我在Cordova工作,但我不认为问题出在cordova上,因为当myLauncher没有作为发射器运行时一切正常。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="">
     <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUSExMVFhUXGBsaGRgYGBoYGhoaGhoYFxgYFx0dHSggGBolGxcXIjEhJSkrLi8uFx8zODMtNygtLisBCgoKDg0OGxAQGy0lHyUtLS0vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAPcAzAMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAEAgMFBgcAAQj/xAA7EAABAgQEBAQEBQQCAgMBAAABAhEAAyExBBJBUQUiYXEGE4GRMkKh8AexwdHhFCNS8WKCctIkM6IV/8QAGQEAAwEBAQAAAAAAAAAAAAAAAQIDAAQF/8QAKhEAAgIDAAIBAgQHAAAAAAAAAAECERIhMQNBURNhIjKB0QRCYnGhscH/2gAMAwEAAhEDEQA/AMSaFSkEkJAJJsBClAx3kquxgAsl+GcMOfnlFdKpdmexMKxflIlqlJCio65a+p27QDJzpcBSub4spPo+8SKpk8ISkLHQEB2FtIm+9FcpNVqkQcuUVFhf2hSpZF4kZ2EU41JqT1hEzCkuVKFB9iGbHi1LS6R2UxPcJwCEIK5yQ6wyArQf5NvH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UuWsgHKCbOc6QyS1HpeOjoZCS2yFM5mSktuz1FDbcsPb3sYwjJQoEhq/wDWpI9y/wC+vkdFJaAi0cP8ReUEpSDS51ctR92A9otOD8TJYEqNnLA19TpHkdE7Keit+IfF6pclRPxrJy9HcAdh+kZitalKzXKiane5cesdHQ0eWAZV+kKlKCcpIdO3YuQNv5jo6KAEOCVH2Gnb2MK/pqAjW0dHQQHhrW0IEyoJ0+xHsdAQB1Myj0G9Hf36Q7LVUBN6bga+28dHQsloDC5EwlnapctqD/r84cxRYO3zXpStx7R0dEP5hK2NoUTUAJTY2JNAddHH1iTlTkMMzA9QT00jo6BJWarP/9k=" style="height:100px; width:100px;"/>
    <p>Description </p>
   </a>

案例1的Logcat:

import { Component } from '@angular/core';
import { TestSubTypeSummaryService } from '../services/testSubTypeSummary.service';
import { OnInit } from '@angular/core'
var Highcharts = require('highcharts');
require ('funnel');
require('exporting');
var completeArray : any[] = [];
@Component({
    selector : 'pyramid-chart',
    template : `
        <div id="pyramid-div" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
    `
})
export class PyramidChart {
    foo:any;
    constructor(private fsService : TestSubTypeSummaryService){

    };

    ngAfterViewInit(){
        this.getTestSubTypeSummary();
    }

    getTestSubTypeSummary() : void{
        this.fsService.getTestSubTypeSummary().subscribe( data => {
            console.log("Chart Data: "+JSON.stringify(data));
            this.parseData(data);
              this.renderChart();
        });
    }

    parseData(data : any) : void{
        var count = data.length;
        for(var i = 0 ; i < count ; i++){
            var funcObjArray : [string,number];
            var typeName = data[i].testSubTypeName;
            var typeCount = data[i].testSubTypeCount
            funcObjArray = [typeName,typeCount];
            completeArray.push(funcObjArray);       
        }
    }

    renderChart() : void{
        Highcharts.chart({
        chart: {
            renderTo : 'pyramid-div',
            type: 'pyramid',
            marginRight: 100
        },
        title: {
            text: 'Test pyramid',
            x: -50
        },
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b> ({point.y:,.0f})',
                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
                    softConnector: true
                }
            }
        },
        legend: {
            enabled: false
        },

        credits: {
            enabled: false
        },
        series: [{
            name: 'Tests',
            data: completeArray
        }]
    });

    }
}

案例2的Logcat:

Intent launchIntent = cordova.getActivity().getApplicationContext().getPackageManager().getLaunchIntentForPackage(args.get(0).toString());
cordova.getActivity().getApplicationContext().startActivity(launchIntent);

1 个答案:

答案 0 :(得分:0)

我做了两处更改,现在可以使用

在清单中,我将android:launchMode="singleTop"添加到活动中,并将意图启动添加到runnable中。

        cordova.getThreadPool().execute(new Runnable() {
            @Override
            public void run() {
                try {
                    Intent launchIntent = cordova.getActivity().getApplicationContext().getPackageManager().getLaunchIntentForPackage(args.get(0).toString());
                    launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
                    cordova.getActivity().getApplicationContext().startActivity(launchIntent);
                } catch (JSONException exp) {
                    Log.e("ERR", "JSON Error");
                } catch (Exception exp) {
                    Log.e("ERR", "Other Error: " + exp.getMessage());
                }

            }

更新: 不,这不起作用。必须混淆apks。如果我一直快速点击应用程序图标,那么该应用程序会立即打开和关闭。