I integrated gmail app in my application and it works great.. But the window of the gmail app is wrapped to full device screen and I don’t want is that?
So please can anyone tell how to customise the window size like dialogbox.
I used following code for gmail integration:
Intent gmail = new Intent(Intent.ACTION_VIEW);
gmail.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
gmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "jckdsilva@gmail.com" });
gmail.setData(Uri.parse("jckdsilva@gmail.com"));
gmail.putExtra(Intent.EXTRA_SUBJECT, "enter something");
gmail.setType("plain/text");
gmail.putExtra(Intent.EXTRA_TEXT, "hi android jack!");
startActivity(gmail);
As Vinod mentioned, this isn’t possible. You’re not “integrating” GMail, you’re just launching it with some custom parameters. (It is part of your application’s task stack, but that’s about it.)
Now, GMail could export a special intent that creates a transparent activity, but this isn’t a common use case, so they don’t. 😉
So, this leaves you with two options:
Keep using GMail in full screen mode. This is what every other app does, so I’d encourage you to stick with this unless you have a very good reason not to.
Write a custom activity that sends the email directly. You’ll need to ask the user for an SMTP server and their login credentials. Or you could use HTTP to forward it to your server and email it from an email address you control.
Which solution you chose depends on what your app is doing.