Android Open Source - dynamic-load-apk Test Fragment






From Project

Back to project page dynamic-load-apk.

License

The source code is released under:

Apache License

If you think the Android project dynamic-load-apk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ryg.dynamicload.sample.mainplugin;
/* w  ww . j a  v  a2  s  .  com*/
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

import com.ryg.dynamicload.internal.DLIntent;
import com.ryg.dynamicload.internal.DLPluginManager;
import com.ryg.dynamicload.sample.mainplugina.R;

public class TestFragment extends Fragment implements OnClickListener{

    private String mPluginPackageName;
    private Button button1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        return inflater.inflate(R.layout.test_fragment, container, false);
    }

    @Override
    public void onResume() {
        button1 = (Button)(getView().findViewById(R.id.button1));
        button1.setOnClickListener(this);
        super.onResume();
    }

    public TestFragment setPluginPackageName(String pluginPackageName) {
        mPluginPackageName = pluginPackageName;
        return this;
    }

    @Override
    public void onClick(View v) {
        if (v == button1) {
            Context context = getActivity();
            DLIntent dlIntent = new DLIntent(mPluginPackageName, MainActivity.class);
            DLPluginManager.getInstance(context).startPluginActivity(context, dlIntent);
        }
        
    }

}




Java Source Code List

com.ryg.dynamicload.DLBasePluginActivity.java
com.ryg.dynamicload.DLBasePluginFragmentActivity.java
com.ryg.dynamicload.DLPlugin.java
com.ryg.dynamicload.DLProxyActivity.java
com.ryg.dynamicload.DLProxyFragmentActivity.java
com.ryg.dynamicload.internal.DLIntent.java
com.ryg.dynamicload.internal.DLPluginManager.java
com.ryg.dynamicload.internal.DLPluginPackage.java
com.ryg.dynamicload.internal.DLProxyImpl.java
com.ryg.dynamicload.sample.docommon.HostInterfaceManager.java
com.ryg.dynamicload.sample.docommon.HostInterface.java
com.ryg.dynamicload.sample.doihost.MainActivity.java
com.ryg.dynamicload.sample.doihost.component.HostComponent.java
com.ryg.dynamicload.sample.doihost.interfacee.HostInterfaceImp.java
com.ryg.dynamicload.sample.doiplugin.MainActivity.java
com.ryg.dynamicload.sample.mainhost.MainActivity.java
com.ryg.dynamicload.sample.mainhost.TestHostClass.java
com.ryg.dynamicload.sample.mainplugin.MainActivity.java
com.ryg.dynamicload.sample.mainplugin.ResourceConstants.java
com.ryg.dynamicload.sample.mainplugin.TestButton.java
com.ryg.dynamicload.sample.mainplugin.TestFragmentActivity.java
com.ryg.dynamicload.sample.mainplugin.TestFragment.java
com.ryg.dynamicload.sample.mainpluginb.MainActivity.java
com.ryg.utils.DLConstants.java
com.ryg.utils.DLUtils.java