I’ve managed to make the whole integration working, but I wanna modify it according to our business process. I have been working on this for days now but I’m still nowhere near completion. Here’s the problem: once I run the app, it should not redirect to salesforce login page yet. It should go first to an Activity where I put a button. Once clicked, that’s the time it should proceed to the login page. I can’t seem to get this part working.
AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".RestIntent"
android:manageSpaceActivity="com.salesforce.androidsdk.ui.ManageSpaceActivity"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainIntent"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MainIntent" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
RestIntent.java
public class RestIntent extends Application {
public static Context context;
@Override
public void onCreate(){
super.onCreate();
context = getApplicationContext();
}
public void buttonclick(){
SalesforceSDKManager.initNative(context, new KeyImpl(), MainIntent.class);
}
}
My MainActivity.java has a function for handling button click:
public void salesforce(View view){
RestIntent app = (RestIntent)getApplication();
app.buttonclick();
}
When I click the button, nothing happens. I think there is something amiss here. Hope you can help.
Thanks.