当前位置: 首页>>代码示例>>Java>>正文


Java Parcel.writeNoException方法代码示例

本文整理汇总了Java中android.os.Parcel.writeNoException方法的典型用法代码示例。如果您正苦于以下问题:Java Parcel.writeNoException方法的具体用法?Java Parcel.writeNoException怎么用?Java Parcel.writeNoException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Parcel的用法示例。


在下文中一共展示了Parcel.writeNoException方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    switch (code) {
        case 1:
            int err = data.readInt();
            DataEntity result = null;
            try {
                result = new DataEntity(data);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            onResultGot(err, result);
            reply.writeNoException();
            break;
        case 2:
            onArrayResultGot(data.readInt(), DataEntity.readFromParcel(data));
            reply.writeNoException();
            break;
    }
    return true;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:TmsCallbackStub.java

示例2: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) {
    String packageName;
    switch (i) {
        case 1:
            parcel.enforceInterface(DESCRIPTOR);
            packageName = getPackageName();
            parcel2.writeNoException();
            parcel2.writeString(packageName);
            return true;
        case 2:
            parcel.enforceInterface(DESCRIPTOR);
            packageName = getActivityName();
            parcel2.writeNoException();
            parcel2.writeString(packageName);
            return true;
        case 1598968902:
            parcel2.writeString(DESCRIPTOR);
            return true;
        default:
            return super.onTransact(i, parcel, parcel2, i2);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:RemoteSSO.java

示例3: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
    switch (i) {
        case 1:
            parcel.enforceInterface("com.xiaomi.xmsf.push.service.IHttpService");
            String doHttpPost = doHttpPost(parcel.readString(), parcel.readHashMap(getClass().getClassLoader()));
            parcel2.writeNoException();
            parcel2.writeString(doHttpPost);
            return true;
        case 1598968902:
            parcel2.writeString("com.xiaomi.xmsf.push.service.IHttpService");
            return true;
        default:
            return super.onTransact(i, parcel, parcel2, i2);
    }
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:16,代码来源:IHttpService.java

示例4: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    switch (code) {
        case 1:
            data.enforceInterface(DESCRIPTOR);
            synRemoveDownload(data.readLong());
            reply.writeNoException();
            return true;
        case 1598968902:
            reply.writeString(DESCRIPTOR);
            return true;
        default:
            return super.onTransact(code, data, reply, flags);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:15,代码来源:IDownloadService.java

示例5: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    switch (code) {
        case 1:
            onScanStarted();
            reply.writeNoException();
            break;
        case 2:
            int type = data.readInt();
            DataEntity result = null;
            try {
                result = new DataEntity(data);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            onRubbishFound(type, result);
            reply.writeNoException();
            break;
        case 3:
            onScanProgressChanged(data.readInt());
            reply.writeNoException();
            break;
        case 4:
            onScanCanceled();
            reply.writeNoException();
            break;
        case 10:
            onScanFinished();
            reply.writeNoException();
            break;
    }
    return true;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:33,代码来源:RubbishScanListenerStub.java

示例6: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
        throws RemoteException {
    switch (code) {
    case INTERFACE_TRANSACTION: {
        reply.writeString(DESCRIPTOR);
        return true;
    }
    case TRANSACTION_getBookList: {
        data.enforceInterface(DESCRIPTOR);
        List<Book> result = this.getBookList();
        reply.writeNoException();
        reply.writeTypedList(result);
        return true;
    }
    case TRANSACTION_addBook: {
        data.enforceInterface(DESCRIPTOR);
        Book arg0;
        if ((0 != data.readInt())) {
            arg0 = Book.CREATOR.createFromParcel(data);
        } else {
            arg0 = null;
        }
        this.addBook(arg0);
        reply.writeNoException();
        return true;
    }
    }
    return super.onTransact(code, data, reply, flags);
}
 
开发者ID:didi,项目名称:VirtualAPK,代码行数:31,代码来源:BookManagerImpl.java

示例7: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
@Override
protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    switch (code){
        case IBinder.FIRST_CALL_TRANSACTION + 0:
            data.enforceInterface("token10086");
            if(data.readInt()==1){//表示客户端传过来的bookName不为空
                reply.writeNoException();
                reply.writeString(getBookInfo(data.readString()));
            }else{
                reply.writeNoException();
                reply.writeString("您输入的书名为空!");
            }
            return true;

        case IBinder.FIRST_CALL_TRANSACTION + 1:
            data.enforceInterface("token10000");
            if(data.readInt()==1){
                reply.writeNoException();
                reply.writeString(getBookList());
            }else{
                reply.writeNoException();
                reply.writeString("查询不到图书列表!");
            }
            return true;
    }
    return super.onTransact(code, data, reply, flags);
}
 
开发者ID:ZhongXiaoHong,项目名称:AIDLExample,代码行数:28,代码来源:LibraryServer.java

示例8: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
    String Pay;
    switch (i) {
        case 1:
            parcel.enforceInterface(DESCRIPTOR);
            Pay = Pay(parcel.readString());
            parcel2.writeNoException();
            parcel2.writeString(Pay);
            return true;
        case 2:
            parcel.enforceInterface(DESCRIPTOR);
            Pay = test();
            parcel2.writeNoException();
            parcel2.writeString(Pay);
            return true;
        case 3:
            parcel.enforceInterface(DESCRIPTOR);
            registerCallback(com.alipay.android.app.IRemoteServiceCallback.Stub.asInterface(parcel.readStrongBinder()));
            parcel2.writeNoException();
            return true;
        case 4:
            parcel.enforceInterface(DESCRIPTOR);
            unregisterCallback(com.alipay.android.app.IRemoteServiceCallback.Stub.asInterface(parcel.readStrongBinder()));
            parcel2.writeNoException();
            return true;
        case 5:
            parcel.enforceInterface(DESCRIPTOR);
            Pay = prePay(parcel.readString());
            parcel2.writeNoException();
            parcel2.writeString(Pay);
            return true;
        case 1598968902:
            parcel2.writeString(DESCRIPTOR);
            return true;
        default:
            return super.onTransact(i, parcel, parcel2, i2);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:39,代码来源:IAlixPay.java

示例9: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    ICustomTabsCallback _arg0;
    Bundle _arg1;
    boolean _result;
    Bundle _result2;
    switch (code) {
        case 2:
            data.enforceInterface("android.support.customtabs.ICustomTabsService");
            long _arg02 = data.readLong();
            _result = this.warmup(_arg02);
            reply.writeNoException();
            reply.writeInt(_result ? 1 : 0);
            return true;
        case 3:
            data.enforceInterface("android.support.customtabs.ICustomTabsService");
            _arg0 = ICustomTabsCallback.Stub.asInterface(data.readStrongBinder());
            boolean _arg12 = this.newSession(_arg0);
            reply.writeNoException();
            reply.writeInt(_arg12 ? 1 : 0);
            return true;
        case 4:
            data.enforceInterface("android.support.customtabs.ICustomTabsService");
            _arg0 = ICustomTabsCallback.Stub.asInterface(data.readStrongBinder());
            Uri _arg11;
            if (0 != data.readInt()) {
                _arg11 = Uri.CREATOR.createFromParcel(data);
            } else {
                _arg11 = null;
            }

            if (0 != data.readInt()) {
                _result2 = Bundle.CREATOR.createFromParcel(data);
            } else {
                _result2 = null;
            }

            ArrayList _arg3 = data.createTypedArrayList(Bundle.CREATOR);
            boolean _result1 = this.mayLaunchUrl(_arg0, _arg11, _result2, _arg3);
            reply.writeNoException();
            reply.writeInt(_result1 ? 1 : 0);
            return true;
        case 5:
            data.enforceInterface("android.support.customtabs.ICustomTabsService");
            String _arg01 = data.readString();
            if (0 != data.readInt()) {
                _arg1 = Bundle.CREATOR.createFromParcel(data);
            } else {
                _arg1 = null;
            }

            _result2 = this.extraCommand(_arg01, _arg1);
            reply.writeNoException();
            if (_result2 != null) {
                reply.writeInt(1);
                _result2.writeToParcel(reply, 1);
            } else {
                reply.writeInt(0);
            }

            return true;
        case 6:
            data.enforceInterface("android.support.customtabs.ICustomTabsService");
            _arg0 = ICustomTabsCallback.Stub.asInterface(data.readStrongBinder());
            if (0 != data.readInt()) {
                _arg1 = Bundle.CREATOR.createFromParcel(data);
            } else {
                _arg1 = null;
            }

            _result = this.updateVisuals(_arg0, _arg1);
            reply.writeNoException();
            reply.writeInt(_result ? 1 : 0);
            return true;
        case 1598968902:
            reply.writeString("android.support.customtabs.ICustomTabsService");
            return true;
        default:
            return super.onTransact(code, data, reply, flags);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:81,代码来源:ICustomTabsService.java

示例10: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    switch (code) {
        case 1:
            data.enforceInterface(DESCRIPTOR);
            onResult(data.readInt(), data.readString());
            reply.writeNoException();
            return true;
        case 2:
            data.enforceInterface(DESCRIPTOR);
            onResLoadBalance(data.readInt(), data.readString());
            reply.writeNoException();
            return true;
        case 3:
            data.enforceInterface(DESCRIPTOR);
            onResInitDevice(data.readInt(), data.readString());
            reply.writeNoException();
            return true;
        case 4:
            data.enforceInterface(DESCRIPTOR);
            onResDevices(data.readInt(), data.readString());
            reply.writeNoException();
            return true;
        case 5:
            data.enforceInterface(DESCRIPTOR);
            onResPush(data.readInt(), data.readString());
            reply.writeNoException();
            return true;
        case 6:
            data.enforceInterface(DESCRIPTOR);
            onError(data.readString());
            reply.writeNoException();
            return true;
        case 7:
            data.enforceInterface(DESCRIPTOR);
            quit();
            reply.writeNoException();
            return true;
        case 1598968902:
            reply.writeString(DESCRIPTOR);
            return true;
        default:
            return super.onTransact(code, data, reply, flags);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:45,代码来源:AIDLActivity.java

示例11: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
/**
 *  处理消息
 * @param code 识别码
 * @param data 调用transact的对象传送过去的参数
 * @param reply 调用onTransact的对象返回的参数
 * @param flags Java里面默认的native方法都是阻塞的,当不需要阻塞的时候设置为IBinder.FLAG_ONEWAY,否则设置为0
 * @return
 * @throws RemoteException
 */
@Override
protected boolean onTransact(final int code, final Parcel data, final Parcel reply, final int flags) throws RemoteException {
    data.enforceInterface(Contant.DESCRIPTOR);
    Bundle bundle = dealMessage(code,data.readBundle());
    reply.writeNoException();
    reply.writeBundle(bundle);
    return true;
}
 
开发者ID:jiangchunyu,项目名称:IPCCommunication,代码行数:18,代码来源:BaseIPCService.java


注:本文中的android.os.Parcel.writeNoException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。