Android Open Source - AndroidPlugin Test Fragment Activity






From Project

Back to project page AndroidPlugin.

License

The source code is released under:

MIT License

If you think the Android project AndroidPlugin 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.limemobile.app.demo.pluginclienta;
// ww  w.ja v a  2 s.  com
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;

import com.limemobile.app.plugin.PluginClientFragmentActivity;
import com.limemobile.app.plugin.internal.PluginClientManager;
import com.limemobile.app.demo.pluginclienta.R;

public class TestFragmentActivity extends PluginClientFragmentActivity
    implements OnClickListener {

  private static final String TAG = "TestFragmentActivity";

  private EditText mEditText;
  private ImageView mImageView;
  private Button mShowFragmentButton;

  private Button mStartPluginB;

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

    setContentView(R.layout.test);
    Toast.makeText(mContext, getIntent().getStringExtra("dl_extra"),
        Toast.LENGTH_SHORT).show();
    TestButton button = (TestButton) findViewById(R.id.button1);
    button.setText(mContext.getResources().getString(R.string.test));
    button.setOnClickListener(new OnClickListener() {

      @Override
      public void onClick(View v) {
        Toast.makeText(mContext, "quit", Toast.LENGTH_SHORT).show();
        mContext.setResult(RESULT_FIRST_USER, new Intent());
        mContext.finish();
      }
    });

    mEditText = (EditText) findViewById(R.id.editText1);
    mEditText.setText(R.string.hello_world);
    mShowFragmentButton = (Button) findViewById(R.id.show_fragment);
    mShowFragmentButton.setOnClickListener(this);

    mStartPluginB = (Button) findViewById(R.id.start_plugin_b);
    mStartPluginB.setOnClickListener(this);
  }

  @Override
  public void onResume() {
    super.onResume();
    mImageView = (ImageView) findViewById(R.id.imageView1);
    mImageView.setImageResource(R.drawable.ppmm);
    Log.d(TAG, "onResume");
  }

  @Override
  public void onPause() {
    super.onPause();
    Log.d(TAG, "onPause");
  }

  @Override
  public void onClick(View v) {
    if (v == mShowFragmentButton) {
      FragmentManager manager = getSupportFragmentManager();
      FragmentTransaction transaction = manager.beginTransaction();
      transaction.add(R.id.fragment_container, new TestFragment());
      transaction.addToBackStack("TestFragment#1");
      transaction.commit();
    } else if (v == mStartPluginB) {
      PluginClientManager.sharedInstance(mContext)
          .startPluginClientActivity(mContext,
              "com.limemobile.app.demo.pluginclientb",
              ".MainActivity");
    }

  }

}




Java Source Code List

android.widget.ViewStub.java
androidx.plmgrdemo.MainActivity.java
androidx.plmgrdemo.PlugListViewAdapter.java
androidx.pluginmgr.ActivityClassGenerator.java
androidx.pluginmgr.ActivityOverider.java
androidx.pluginmgr.FileUtil.java
androidx.pluginmgr.FrameworkClassLoader.java
androidx.pluginmgr.LayoutInflaterWrapper.java
androidx.pluginmgr.PlugInfo.java
androidx.pluginmgr.PluginActivityLifeCycleCallback.java
androidx.pluginmgr.PluginClassLoader.java
androidx.pluginmgr.PluginContextWrapper.java
androidx.pluginmgr.PluginManager.java
androidx.pluginmgr.PluginManifestUtil.java
androidx.pluginmgr.ReflectionUtils.java
androidx.pluginmgr.XmlManifestReader.java
com.limemobile.app.demo.pluginclienta.ClientABindService.java
com.limemobile.app.demo.pluginclienta.ClientAStartedService.java
com.limemobile.app.demo.pluginclienta.MainActivity.java
com.limemobile.app.demo.pluginclienta.TestButton.java
com.limemobile.app.demo.pluginclienta.TestFragmentActivity.java
com.limemobile.app.demo.pluginclienta.TestFragment.java
com.limemobile.app.demo.pluginclientb.ClientBStartedService.java
com.limemobile.app.demo.pluginclientb.MainActivity.java
com.limemobile.app.demo.pluginhost.HostBindService.java
com.limemobile.app.demo.pluginhost.HostStartedService.java
com.limemobile.app.demo.pluginhost.MainActivity.java
com.limemobile.app.demo.pluginhost.MyApplication.java
com.limemobile.app.demo.pluginhost.TestHostClass.java
com.limemobile.app.plugin.IPluginActivity.java
com.limemobile.app.plugin.IPluginContentProvider.java
com.limemobile.app.plugin.IPluginService.java
com.limemobile.app.plugin.PluginClientActivity.java
com.limemobile.app.plugin.PluginClientFragmentActivity.java
com.limemobile.app.plugin.PluginClientService.java
com.limemobile.app.plugin.PluginHostApplication.java
com.limemobile.app.plugin.PluginHostContentProvider.java
com.limemobile.app.plugin.PluginHostDelegateActivity.java
com.limemobile.app.plugin.PluginHostDelegateContentProvider.java
com.limemobile.app.plugin.PluginHostDelegateFragmentActivity.java
com.limemobile.app.plugin.PluginHostDelegateService.java
com.limemobile.app.plugin.internal.IPluginActivityDelegate.java
com.limemobile.app.plugin.internal.IPluginContentProviderDelegate.java
com.limemobile.app.plugin.internal.IPluginServiceDelegate.java
com.limemobile.app.plugin.internal.PluginClientDexClassLoader.java
com.limemobile.app.plugin.internal.PluginClientInfo.java
com.limemobile.app.plugin.internal.PluginClientManager.java
com.limemobile.app.plugin.internal.PluginDelegateActivityImpl.java
com.limemobile.app.plugin.internal.PluginDelegateContentProviderImpl.java
com.limemobile.app.plugin.internal.PluginDelegateServiceImpl.java
com.limemobile.app.plugin.internal.ReflectFieldAccessor.java