Android Open Source - HomeWork About Activity






From Project

Back to project page HomeWork.

License

The source code is released under:

GNU General Public License

If you think the Android project HomeWork 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.wachid.homework;
//from ww w. j a  va 2  s .com

import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarActivity;
 
 
import android.support.v7.widget.ShareActionProvider;
import android.view.Menu;
import android.view.MenuItem;
import android.content.Intent;
import android.os.Bundle;

 
 

public class AboutActivity  extends ActionBarActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    
    
  }
  
   @Override
    public boolean onCreateOptionsMenu(Menu menu) {

      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.detail, menu);
    
       // Set up ShareActionProvider's default share intent
        MenuItem shareItem = menu.findItem(R.id.action_share);
        ShareActionProvider mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareItem);
        mShareActionProvider.setShareIntent(ActionShare());
     
      
        return super.onCreateOptionsMenu(menu);
    }
   
   private Intent ActionShare() {
        Intent intent = new Intent(Intent.ACTION_SEND);
      //  intent.setType("image/*");
       
        intent.putExtra(Intent.EXTRA_TEXT, " saroh");
        intent.setType("text/plain");
        return intent;
    }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      case android.R.id.home:
          finish();
          return true;
      default:
          return super.onOptionsItemSelected(item);
      }
  }
}




Java Source Code List

com.wachid.homework.AboutActivity.java
com.wachid.homework.DetailActivity.java
com.wachid.homework.HelpActivity.java
com.wachid.homework.HomeWork.java
com.wachid.homework.HwDbAdapter.java
com.wachid.homework.MainActivity.java