Not sure how to explain this,hope you understand me.. Here is the problem :
I have a few packages in my app and I'm doing this :
Intent intent = new Intent(view.getContext(), com.example.app.Lol.class);
startActivity(intent);
and his code is in class which is in package : com.example.anotherone
It's not possible as I saw, that's why I'm asking..what I have to do, so I can be able to create an Intent like the example above.
Thanks anyway!
Make sure you are importing the class you want
import com.example.anotherone.Classname;
and pass Classname.class in your intent,
Intent intent = new Intent(view.getContext(), Classname.class);
And that your Manifest is updated with the correct name for the activity (com.example.anotherone.Classname).
1.At first import the class you want.
2.pass the class name with intent.
For example:
If you want to start an activity from another application, you can do it by specifying the intent action. When you define the activity you want to start in its application Manifest file, you can set it's
<action/>
tag inside<intent-filter/>
to whatever action you want. Then to start this activity from another application callYour application will be the only to answer on this action request and it will open. Hope this helps.