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 6052701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:57:26+00:00 2026-05-23T07:57:26+00:00

I’m making login application for Android i’m stucked at the user’s login status if

  • 0

I’m making login application for Android

i’m stucked at the user’s login status

if the user has logged in, the login activity will not displayed and the application will proceed to main activity

this is for saving logged in user data, such as username, id, coordinates, etc

loginVars.java

package com.nigmagrid.go;

import android.app.Application;

public class loginVars extends Application{

    private static String npp;
    private static String nama;
    private static String id;
    private static String lokasi_tugas;
    private static String koordinat;

    @Override
    public void onCreate() {
        super.onCreate();
        npp = "";
        nama = "";
        id = "";
        lokasi_tugas = "";
        koordinat = "";
    }

    public static String getNPP() {
        return npp;
    }

    public static void setNPP(String npp) {
        loginVars.npp = npp;
    }

    public static String getNama() {
        return nama;
    }

    public static void setNama(String nama) {
        loginVars.nama = nama;
    }

    public static String getId() {
        return id;
    }

    public static void setId(String id) {
        loginVars.id = id;
    }

    public static String getLokasiTugas() {
        return lokasi_tugas;
    }

    public static void setLokasiTugas(String lokasi_tugas) {
        loginVars.lokasi_tugas = lokasi_tugas;
    }

    public static String getKoordinat() {
        return koordinat;
    }

    public static void setKoordinat(String koordinat) {
        loginVars.koordinat = koordinat;
    }
}

and this is my login status checker

public boolean Logged(){

        String npp = loginVars.getNPP().toString();
        String nama = loginVars.getNama().toString();
        String id = loginVars.getId().toString();
        //String koordinat = vars.getKoordinat().toString();

        if(npp.equals("") || nama.equals("") || id.equals("")){
            return false;
        }else{
            return true;
        }
    }

and this is where i placed the checker on my login.java

     public void onCreate(Bundle icicle) {
            super.onCreate(icicle);

            if(Logged()){
                Intent gotoApp = new Intent(getApplicationContext(), inputBarcode.class);
                startActivity(gotoApp);
            }

//scripts for login

the login checker wont work, and the application stopped
how do i fix this?

or you maybe have a solution how to make login checker?

thanks

  • 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-05-23T07:57:27+00:00Added an answer on May 23, 2026 at 7:57 am

    Here is a workaround. You can save the user info in any UserInfo.txt while logging in the user.
    then you can check the file

    public static boolean checkLogin()
    {
        File file = context.getFileStreamPath("UserInfo.txt");
        return file.exists();
    }
    

    If the file exists, it indicates the User is logged in, you can proceed to the InputBarcode.class. Else the User have to logged in.

    while doing logout, Just delete the file.

    context.deleteFile("UserInfo.txt");
    

    and the file will be deleted.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I need to clean up various Word 'smart' characters in user input, including but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker

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.