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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:34:07+00:00 2026-06-03T07:34:07+00:00

I have a variable ekinismi. And when I add String(s) to it. I receive

  • 0

I have a variable “ekinismi”. And when I add String(s) to it. I receive the “eklist” from another activities with EkinIsmi() method.

static List<String> eklist = new ArrayList<String>();

public List<String> EkinIsmi() 
    {
        return eklist;
    }

But this list return me “null” and my list items. But I just want to receive only list items. How can I do that with a for loop or something. Null(s) are not String so I can’t use equals or compareto for split the null(s) from my list.

This code sample is working good for me, but as you see, I give the list items number to the “i”. But it has to understand what the list has.

if(ekinismi.size() > 1)
            {
                for(int i=ekinismi.size()-1; i>ekinismi.size()-3; i--)
                dosyaAdi.setText(String.valueOf(ekinismi.get(i)));
            }

enter image description here

I click the position = 0 list item and then click the next one and at the dosyaAdi.setText() is set first and next one’s “s” . I mean I need to clear all the list items. Because it holds the first one’s. Where should I put the list.clear()? Actually, I already do that but it didn’t change anything, I think maybe I put it to wrong line.

List<String> list = new ArrayList<String>();
        if( ekvarmı == true)
        {
            if(ekinismi.size() >= 1)
            {
                for(String s : ekinismi) 
                    {
                       if(s != null) 
                       {
                           list.add(s);
                       }
                    }
                 dosyaAdi.setText(String.valueOf(list));
            }
        }
  • 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-03T07:34:09+00:00Added an answer on June 3, 2026 at 7:34 am
    for(String s : ekilist) {
       if(s != null) {
           doSomething(s);
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have variable of type IEnumerable<List<string>> is there a LINQ statement or lambda
i have variable $lang which convert string to the selected language but i am
I have a variable that im define with another variable and some text. $title
I have a variable containing a string. The string can come in several ways:
I have a variable that can either contain a list of strings or a
I have variable: String colorName = BLUE; I want to set this color to
In a particular situation I need to have variable (character array or std:string) where
So let's say I have variable like this one: $q = DB::select('id')->from('reports')->where('field', '=', 'value');;
How can I add a variable to an array? Let say I have variable
I have variable that store data datetime UTC from database. I want to make

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.