Someone please help me out!

i imported whole android packages but still i got compile time error .

package mohin.patel.launch_app;

import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.UsesPermissions;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;

import android.app.*;
import android.os.*;
import android.view.*;
import android.view.View.*;
import android.widget.*;
import android.content.*;
import android.graphics.*;
import android.media.*;
import android.net.*;
import android.text.*;
import android.util.*;
import android.webkit.*;
import android.animation.*;
import android.view.animation.*;
import java.util.*;
import java.text.*;
import android.widget.LinearLayout;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import java.util.Timer;
import java.util.TimerTask;
import android.content.Intent;
import android.net.Uri;
import android.content.pm.PackageManager;

@DesignerComponent(
  version = 1,
  description = "Simple extension to launch any app.",
  category = ComponentCategory.EXTENSION,
  nonVisible = true,
  iconName = "")

@SimpleObject(external = true)
public final class launch_app extends AndroidNonvisibleComponent {

  /**
   * Creates a new component
   */
  public launch_app(ComponentContainer container) {
    super(container.$form());
  }
@SimpleFunction(description = "Simple yesying function")
public void launchApp(String str)
{
    Intent launchIntent = getPackageManager().getLaunchIntentForPackage(str);
    launchApp.startActivity();
   
}
}

error:-

cannot find symbol
    [javac]     launchApp.startActivity();
    [javac]     ^
    [javac]   symbol:   variable launchApp
    [javac]   location: class launch_app
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 2 errors
    [javac] 4 warnings

Is this related to an earlier topic? You are making a lot of topics the last day all related to extension developing. Maybe stick to one topic instead of flooding the forum. You are still learning as you say so i guess you will otherwise make a lot more topics.

So what should I do sir ? I am stucked on this topic for last 2 days and you know that there are very less Tutorials,No one is helping instead of giving proper answer they are just sharing extension documentation link or group link or older Post links.
My simple question is why it is showing me error when I use any Android packages ?(like intent, webkit,etc.)

launchApp.startActivity();
Should be
startActivity(launchIntent);

2 Likes

What type of extensions are you trying to create !