When i try to pass from the main project to library project using intent it works fine but..... when i try to pass from the library project to the main project, it doesn't recognize the class in the main project.
i try to write in my library project this intent :
Intent intent = new Intent(this,com.example.uploadvideo.class);
The library project does not know about the main project. The prefered solution imo would be to use an action rather than trying to load the class directly in the intent. This will also give you more flexibility if you want to re-use the library.
So the library would do
Intent intent = new Intent("com.example.action_video_upload"); intent.setPackage(mContext.getPackageName()); // only deliver to host app
and the main project would register for that intent in the manifest with
<intent-filter . . . > <action android:name="com.example.action_video_upload" /> </intent-filter>
More information can be found here: developer.android.com