Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9324813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:41:34+00:00 2026-06-19T04:41:34+00:00

I want to display certain content on a section if the user is logged

  • 0

I want to display certain content on a section if the user is logged in. However, if the user isn’t logged in, I would like to show a dialog prompting the user to login. I would also like to display the facebook login button inside this dialog.

However, the login button inside the dialog doesn’t seem to work. And when I place it inside the activity layout, it does work.

Is there a way to make it function correctly inside the dialog?

Here is the dialog xml:

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ImageView
        android:id="@+id/heart"
        android:layout_width="80dp"
        android:layout_height="70dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="70dp"
        android:background="@drawable/favorite_dialog"/>

    <TextView
        android:id="@+id/question_favorites"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFFFFF" 
        android:layout_below="@+id/heart"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="20dp"
        android:layout_centerHorizontal="true"
        android:textStyle="bold"
        android:textSize="20sp"/>

     <TextView
        android:id="@+id/explanation_favorites"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFFFFF" 
        android:layout_below="@+id/question_favorites"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        android:textSize="18sp"
        android:textStyle="italic"
        android:layout_centerHorizontal="true"/>

     <com.facebook.widget.LoginButton
        android:id="@+id/authButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_above="@+id/button"
        android:layout_centerHorizontal="true"
        />

    <Button 
        android:id="@+id/button"
        android:layout_height="40dp"
        android:layout_width="200dp"
        android:text="Cancelar"
        android:textStyle="bold"
        android:textSize="18sp"
        android:layout_marginTop="10dp"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="30dp"
        android:background="@drawable/cancel"/>

</RelativeLayout>

This dialog is shown on the onCreate method, and it contains a cancel button which dismisses it.

I would appreciate any help. Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:41:35+00:00Added an answer on June 19, 2026 at 4:41 am

    I figured this one out, it was quite simple, but not so elegant.

    What I did was to put the facebook login button inside the main layout, hidden. Then, I set up a listener on the dialog button, and inside it I added “facebookLogin.performClick();”.

    That redirected the click to the facebook login listener.

    Thanks anyways!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Drupal 6, I would like to have certain Content Types display Error 404,
Something in PHP, I want to display content if a certain variable exists. For
i want to display a dialog in my android application where certain TextViews in
In My HTML Page I want to display certain Number of Buttons Based on
I want to display a div if a certain radio button in a form
I want to make the user to wait for a certain amount of time
I am writing an article in LaTeX and I would like to display some
I have a website which needs a certain font to display its content properly.
I want to drop a div down to a certain height to display some
I want display data from database in Listbox...Here is my code, It is not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.