當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。